Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start and End time ranges are not accurate #411

Closed
apirvane opened this issue Apr 17, 2023 · 2 comments
Closed

Start and End time ranges are not accurate #411

apirvane opened this issue Apr 17, 2023 · 2 comments

Comments

@apirvane
Copy link

apirvane commented Apr 17, 2023

There seems to be a problem when calculating the Start and End date-time ranges.
The following code:
const holidays = new Holidays('RO', { timezone: 'Europe/Bucharest', types: ['public'] }); console.log(holidays.getHolidays(2023));

Produces this result:
image

If you think in hours, then the Red case does not make sense.
If you think in Dates (ignore the Time), then the Blue case does not make sense.
I assume that we should not ignore the Time component.

@commenthol
Copy link
Owner

Hi @alexpirvanescu,
I am sorry but I don't get what your issue is about. rule 01-01 is exactly 24 hours are defined in RO.yaml. Same applies to rule 01-24.

@apirvane
Copy link
Author

apirvane commented Apr 22, 2023

Hi @alexpirvanescu, I am sorry but I don't get what your issue is about. rule 01-01 is exactly 24 hours are defined in RO.yaml. Same applies to rule 01-24.

Hi @commenthol
Sorry, please allow me to rephrase my point above - RO Public holidays in Jan 2023 are 1st of Jan, 2nd of Jan and 24th of Jan, in total 3 Public holidays in Jan.
Looking at the output of getHolidays() (above), at the Start and End properties, the difference between '1st of Jan 00:00:00' and '2nd of Jan 00:00:00' is just 1 day - I would have expected this to be 2 days, so then my expectation of the output of getHolidays() (for Jan) would look like this, if we think 1 day is between ' a startDate 00:00:00' and 'an endDate 00:00:00':
end: Tue Jan 03 2023 00:00:00
start: Sun Jan 01 2023 00:00:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants