commenthol / date-holidays-parser

parser for worldwide holidays
ISC License
46 stars 23 forks source link

TypeError After UnsetRule #56

Open papaspiridis opened 1 year ago

papaspiridis commented 1 year ago

Hello, I want to ignore a holiday by using unsetRule. The holiday does not appear in the list returned by getHolidays however when checking for that date using isHoliday I get the following Typerror

const hd = new Holidays();
hd.init('GR', { types: ['public'] });
hd.isHoliday('2023-04-14'); //returns true
hd.unsetRule('orthodox -2'); //returns true
hd.isHoliday('2023-04-14'); // => throws error
Uncaught TypeError: Cannot read property 'inYear' of undefined
    at Holidays.isHoliday (node_modules/date-holidays-parser/lib/Holidays.cjs:220:33)
    at Holidays._dateByRule (node_modules/date-holidays-parser/lib/Holidays.cjs:396:28)