Update localstorage on first load
This commit is contained in:
@@ -31,6 +31,9 @@
|
|||||||
if (storedCountry) selectedCountry = storedCountry;
|
if (storedCountry) selectedCountry = storedCountry;
|
||||||
if (storedDaysOff) daysOff = parseInt(storedDaysOff);
|
if (storedDaysOff) daysOff = parseInt(storedDaysOff);
|
||||||
|
|
||||||
|
// Ensure holidays are updated after loading settings
|
||||||
|
updateHolidays();
|
||||||
|
|
||||||
fetchCountryCode();
|
fetchCountryCode();
|
||||||
adjustInputWidth(inputElement);
|
adjustInputWidth(inputElement);
|
||||||
inputElement.addEventListener('input', () => {
|
inputElement.addEventListener('input', () => {
|
||||||
@@ -73,6 +76,7 @@
|
|||||||
}
|
}
|
||||||
if (typeof window !== 'undefined') { // Check if running in the browser
|
if (typeof window !== 'undefined') { // Check if running in the browser
|
||||||
localStorage.setItem('year', year); // Save to local storage
|
localStorage.setItem('year', year); // Save to local storage
|
||||||
|
localStorage.setItem('daysOff', daysOff); // Save to local storage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user