commenthol / date-holidays

worldwide holidays
https://commenthol.github.io/date-holidays/
Other
918 stars 238 forks source link

Start and End time ranges are not accurate #411

Closed apirvane closed 1 year ago

apirvane commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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