mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 05:11:31 -05:00
first version of meal plan diaglo
This commit is contained in:
@@ -80,19 +80,17 @@ type MealPlanGridItem = {
|
||||
const meal_plan_grid = computed(() => {
|
||||
let grid = [] as MealPlanGridItem[]
|
||||
|
||||
if (useMealPlanStore().plan_list.length > 0) {
|
||||
console.log('found plans')
|
||||
for (const x of Array(4).keys()) {
|
||||
let grid_day_date = DateTime.now().plus({days: x})
|
||||
console.log('going trough days ', x, grid_day_date)
|
||||
grid.push({
|
||||
date: grid_day_date,
|
||||
create_default_date: grid_day_date.toISODate(), // improve meal plan edit modal to do formatting itself and accept dates
|
||||
date_label: grid_day_date.toLocaleString(DateTime.DATE_MED),
|
||||
plan_entries: useMealPlanStore().plan_list.filter((m: MealPlan) => ((DateTime.fromJSDate(m.fromDate).startOf('day') <= grid_day_date.startOf('day')) && (DateTime.fromJSDate((m.toDate != undefined) ? m.toDate : m.fromDate).startOf('day') >= grid_day_date.startOf('day')))),
|
||||
} as MealPlanGridItem)
|
||||
}
|
||||
for (const x of Array(4).keys()) {
|
||||
let grid_day_date = DateTime.now().plus({days: x})
|
||||
console.log('going trough days ', x, grid_day_date)
|
||||
grid.push({
|
||||
date: grid_day_date,
|
||||
create_default_date: grid_day_date.toISODate(), // improve meal plan edit modal to do formatting itself and accept dates
|
||||
date_label: grid_day_date.toLocaleString(DateTime.DATE_MED),
|
||||
plan_entries: useMealPlanStore().plan_list.filter((m: MealPlan) => ((DateTime.fromJSDate(m.fromDate).startOf('day') <= grid_day_date.startOf('day')) && (DateTime.fromJSDate((m.toDate != undefined) ? m.toDate : m.fromDate).startOf('day') >= grid_day_date.startOf('day')))),
|
||||
} as MealPlanGridItem)
|
||||
}
|
||||
|
||||
return grid
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user