Add state selection

This commit is contained in:
Zachary
2024-11-13 00:52:28 +01:00
parent ae7057463a
commit 98bb16730e
2 changed files with 78 additions and 26 deletions

View File

@@ -29,8 +29,8 @@ const daysBetween = (startDate, endDate) => Math.round((endDate - startDate) / M
const formatDate = date => date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
// Get holidays for a specific year and country
export function getHolidaysForYear(countryCode, year) {
const hd = new Holidays(countryCode);
export function getHolidaysForYear(countryCode, year, stateCode = '') {
const hd = new Holidays(countryCode, stateCode);
return hd.getHolidays(year)
.filter(holiday => holiday.type === 'public')
.map(holiday => ({