Oprava pádu o víkendech

This commit is contained in:
Martin Berka 2023-10-15 20:47:59 +02:00
parent 6d89858e3e
commit f2983b4397

View File

@ -100,6 +100,13 @@ async function getMenu(date: Date): Promise<WeekMenu | undefined> {
export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): Promise<DayMenu> {
const usedDate = date ?? getToday();
const dayOfWeekIndex = getDayOfWeekIndex(usedDate);
if (getIsWeekend(usedDate)) {
return {
lastUpdate: getHumanTime(new Date()),
closed: true,
food: [],
};
}
let menus = await getMenu(usedDate);
if (menus == null) {