mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Add holidays to calendar
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
function loadCalendar() {
|
||||
const newCalendarDays = [] as CalendarDay[];
|
||||
|
||||
calendarStore.getUpcoming(calendarDayCount).then((upcoming) => {
|
||||
calendarStore.getUpcoming(calendarDayCount, true).then((upcoming) => {
|
||||
const currentDay = startOfDay(currentTime.value);
|
||||
|
||||
for (let i = 0; i < calendarDayCount; i++) {
|
||||
@@ -78,7 +78,7 @@
|
||||
loadCalendar();
|
||||
|
||||
setInterval(() => currentTime.value = new Date(), 1000);
|
||||
setInterval(() => loadCalendar(), 60000);
|
||||
setInterval(() => loadCalendar(), 30 * 60 * 1000);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -8,8 +8,8 @@ export const useCalendarStore = defineStore('calendar', {
|
||||
return {};
|
||||
},
|
||||
actions: {
|
||||
async getUpcoming(days: number): Promise<CalendarEntry[]> {
|
||||
const response = await axios.get<CalendarEntry[]>(Environment.getUrlPrefix() + `:8081/api/calendar/calendar/upcoming?days=${days}`);
|
||||
async getUpcoming(days: number, includeHolidays: boolean): Promise<CalendarEntry[]> {
|
||||
const response = await axios.get<CalendarEntry[]>(Environment.getUrlPrefix() + `:8081/api/calendar/calendar/upcoming?days=${days}&includeHolidays=${includeHolidays}`);
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user