Comments (4)
Hi,
I think the expected result depends on how public holidays are perceived.
For your example I strongly believe that the public will celebrate New Year on January 1st.
As this falls 2022 on a Saturday (where people usually have a day off) the legislative moves the day-off from a non-working to a working day.
Calendars on the Internet do the same. https://www.timeanddate.com/holidays/australia/
from date-holidays-parser.
Hi, and thanks for your quick reply.
I agree people will celebrate on Jan 1st. :-) And generally only if they normally do not work on Saturdays. In Australia, with a highly casualised workforce, Saturdays are often normal work days. And yes, it depends upon what one means by "Public Holiday".
Since the Public Holiday / Day off is, as the rules say, on Monday in 2022, it would be great to have an option that flags the "Day off" ie Monday, where the rules say that is a holiday. So for 2022/23 return both records as now, but Mon 3rd/2nd is flagged as the "day off" and in years where Jan 1st falls on a weekday, that Jan 1st would be flagged as the "day off".
The timeanddate link you sent correctly identifies the Monday as a "Day off", so a flag on the returned record that indicated that would be really helpful and I can adjust the displayed text if there are 2 records depending on how I need to use it.
I currently parse the returned records looking for "duplicates" and remove the redundant one, but since your functions are determining that anyway a boolean on the record would be simpler.
Thanks again for your work and for your consideration,
Murray
from date-holidays-parser.
Hi @flowt-au,
Now I got your point. Yes for substitute days there should be a substitute flag being set. This is missing for this particular case.
Will reopen as a bug.
from date-holidays-parser.
Thanks so much! That will simplify things on my side. :-)
Go well,
Murray
from date-holidays-parser.
Related Issues (20)
- isHoliday does not have the correct typescript definition for return type HOT 1
- Problem with date in different timezone (UTC Offset) HOT 2
- Error: this._shorten is not a function
- o.str.substr is not a function HOT 1
- isHolidays should return a list of holidays instead of a single date
- Weekday spelling in rules is in lowercase only
- Proposal: New rule for attribution of active/ inactive holidays HOT 2
- Custom holiday list HOT 1
- Get holidays for a subset (or all) the available countries HOT 1
- Must use import to load ES Module HOT 1
- Syntax error on non-CommonJS import HOT 3
- Including in Angular causing commonjs warnings HOT 1
- How to make the lib more lightweight ?
- parsing PT12H truncates end at midnight - is this desired behaviour?
- Replace moment dependency with a modern library HOT 2
- TypeError After UnsetRule
- Export typescript definitions
- Data? HOT 3
- set Day Off HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from date-holidays-parser.