diff --git a/src/rssScraper.ts b/src/rssScraper.ts index a39cb36..a1a1e63 100644 --- a/src/rssScraper.ts +++ b/src/rssScraper.ts @@ -88,7 +88,7 @@ export const scrapeRssFeed = async(url: string) => { } export const getCurrentDayDishes = (lunchList: any): string => { - const dayIndex = Math.min(new Date().getDay() - 1, 4); + const dayIndex = Math.max(0, Math.min(new Date().getDay() - 1, 4)); return lunchList[dayIndex].dishes.reduce((acc: string, cur: string) => acc += cur + '\n', ''); }