Zobrazování data u poslední aktualizace menu
This commit is contained in:
@@ -99,9 +99,10 @@ 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);
|
||||
const now = new Date().getTime();
|
||||
if (getIsWeekend(usedDate)) {
|
||||
return {
|
||||
lastUpdate: getHumanTime(new Date()),
|
||||
lastUpdate: now,
|
||||
closed: true,
|
||||
food: [],
|
||||
};
|
||||
@@ -117,7 +118,7 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): P
|
||||
}
|
||||
if (menus[i][restaurant] == null) {
|
||||
menus[i][restaurant] = {
|
||||
lastUpdate: getHumanTime(new Date()),
|
||||
lastUpdate: now,
|
||||
closed: false,
|
||||
food: [],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user