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.swiftand add the package to your project’s dependencies:📝 Usage
LocalDate
The class
LocalDateis used to abstract away the concept of time and time zones.LocalDatecan be converted toDateand the other way around.Swift’s
Dateclass can also be used. The related methods require aTimeZoneto interpret the date. If left unspecified, the default time zone for the given country (or state) will be used.An instance of
CountryorCountryWithStatecan be initialized to generate a list of its holidays.🌍 Supported Countries
You can also call
Country.availableCountriesto 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.