A swifty library for checking whether a given Date is a holiday in a specific country or state. It can also generate a list of holidays in a given year.
📱 Example Project
Feel free to take a look at SwiftyHolidays Example to get a better feeling of how to use this library.
⚙️ Installation
Xcode Project
Open your project in Xcode, click File > Swift Packages > Add Package Dependency and enter https://github.com/MaxHaertwig/SwiftyHolidays.git.
Swift Package
Open Package.swift and add the package to your project’s dependencies:
Swift’s Date class can also be used. The related methods require a TimeZone to interpret the date. If left unspecified, the default time zone for the given country (or state) will be used.
📅 SwiftyHolidays
A swifty library for checking whether a given Date is a holiday in a specific country or state. It can also generate a list of holidays in a given year.
📱 Example Project
Feel free to take a look at SwiftyHolidays Example to get a better feeling of how to use this library.
⚙️ Installation
Xcode Project
Open your project in Xcode, click File > Swift Packages > Add Package Dependency and enter
https://github.com/MaxHaertwig/SwiftyHolidays.git
.Swift Package
Open
Package.swift
and add the package to your project’s dependencies:📝 Usage
LocalDate
The class
LocalDate
is used to abstract away the concept of time and time zones.LocalDate
can be converted toDate
and the other way around.Swift’s
Date
class can also be used. The related methods require aTimeZone
to interpret the date. If left unspecified, the default time zone for the given country (or state) will be used.An instance of
Country
orCountryWithState
can be initialized to generate a list of its holidays.🌍 Supported Countries
You can also call
Country.availableCountries
to get a list of supported countries.🤝 Contributions
Feedback, Issues, and Pull Requests are always welcome.
📄 License
SwiftyHolidays is released under the MIT license. See LICENSE for more information.