maxhaertwig / swiftyholidays Goto Github PK
View Code? Open in Web Editor NEWA swifty library to determine whether a date is a holiday in a given country.
License: MIT License
A swifty library to determine whether a date is a holiday in a given country.
License: MIT License
How can I add missing holiday for my country?
Hello,
I was surprised to see that SwiftyHolidays
considers 2021-12-31
a holiday in the U.S., specifically New Year's Day
. I checked and 2021-12-31
is not a Federal Holiday
. In addition, Wall Street
was open on that day. Why is then 2021-12-31
considered a holiday?
This is my code snippet:
func isUnitedStatesHoliday() -> Bool {
let localDate = self.asLocalDate(in: TimeZone(abbreviation: "EST")!)
return localDate.isHoliday(in: .unitedStates)
}
local date looks like:
(lldb) po localDate
▿ LocalDate
- year : 2021
- month : 12
- day : 31
SwiftyHolidays
API, public func getHoliday(in country: Country) -> Holiday?
, returns:
(lldb) po country.allHolidays(in: year).first { $0.date == self }
▿ Optional<Holiday>
▿ some : Holiday
- name : "New Year\'s Day (observed)"
▿ date : LocalDate
- year : 2021
- month : 12
- day : 31
Shouldn't New Year's Day
fall on January 1st
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.