commenthol / date-holidays

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

Incorrect Holiday Recognition on November 15, 2023, for Japan Locale #437

Closed tak001 closed 7 months ago

tak001 commented 8 months ago

I am using the date-holidays library to fetch holidays for the Japan locale. However, I have encountered an issue where November 15, 2023, is being recognized as a holiday, which is incorrect according to the official holiday calendar of Japan. Below is the code snippet demonstrating the issue:

import Holidays from 'date-holidays';

export class Dater {
  static holidays: Holidays = new Holidays('JP');

  static isJapaneseHoliday(date: Date): boolean {
    const res = this.holidays.isHoliday(date);
    if (!res) {
      return false;
    }
    return res?.length > 0;
  }
}

With the above code, isJapaneseHoliday returns true for November 15, 2023, which is erroneous. Please advise on how to rectify this issue or if a fix will be provided in a future update. Thank you.

commenthol commented 8 months ago

Hi @tak001, you describe that there is an error with a day. It would be nice and helpful if you could describe what you expect us/me from doing with the holiday on Nov 15th.

Basiiil commented 7 months ago

@commenthol Incorrect Holiday Recognition on September 24, 2023, for Iran Locale This date is an official holiday in our country, but this package shows the previous day, September 23, as a holiday I have seen this bug on other holidays too, if there is a solution, tell me Thanks

tak001 commented 7 months ago

Hi @commenthol, November 15th is definitely 'Shichi-Go-San' (7-5-3), but it is not a public holiday in Japan. It is a weekday. Thanks

BigWestGang commented 7 months ago

Hi @commenthol Supplemental info. There are many "Sekku" (seasonal festivals) in Japan, but most of them are not holidays decided by the Japanese government. "Shichi-Go-San" is one of such "Sekku" that is not a holiday. Thanks for maintaining this useful library. :)

commenthol commented 7 months ago

Hi,

The holiday IMO is correctly attributed as observance:

See data/countries/JP.yaml and read the meaning of holiday types at docs/specification.md

      11-15:
        name:
          en: Seven-Five-Three Festival
          jp: 七五三
        type: observance

If you think this needs correction please consider opening a PR.