Closed Willham12 closed 9 months ago
All my tests are running 15sec with moment-feiertage holiday check and over 1 day with this library.
The library provides a list of holidays per gregorian year. So iterating over each day is not the best idea. This does the same in a matter of milliseconds.
const hd = new Holidays();
hd.init("DE", "B", { types: ['public']});
for (let y = 2020; y < 2023; y++) {
const list = hd.getHolidays(y);
for (const { date } of list) {
console.log(date);
}
}
In my case i have to check every day over a long period to check if its holiday. One of my tests running 200ms without the holiday check and over 12s with the holiday check.
Here is small example: