Sorted by current day in meal plan
This commit is contained in:
parent
b454960676
commit
65513a8f60
@ -92,6 +92,7 @@
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
|
||||
{% if request.user.userpreference.left_handed %}
|
||||
{% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %}
|
||||
<a class="navbar-brand p-0 me-2 justify-content-center" href="{% base_path request 'base' %}"
|
||||
|
@ -363,20 +363,26 @@ export default {
|
||||
}
|
||||
},
|
||||
mobileSimpleGrid() {
|
||||
let grid = []
|
||||
|
||||
if (this.current_period !== null) {
|
||||
for (const x of Array(7).keys()) {
|
||||
let moment_date = moment(this.current_period.periodStart).add(x, "d")
|
||||
grid.push({
|
||||
date: moment_date,
|
||||
create_default_date: moment_date.format("YYYY-MM-DD"), // improve meal plan edit modal to do formatting itself and accept dates
|
||||
date_label: moment_date.format("dd") + " " + moment_date.format("ll"),
|
||||
plan_entries: this.plan_items.filter((m) => moment_date.isBetween(moment(m.startDate), moment(m.endDate), 'day', '[]'))
|
||||
})
|
||||
}
|
||||
let grid = [];
|
||||
let currentDate = moment();
|
||||
for (let x = 0; x < 7; x++) {
|
||||
let moment_date = currentDate.clone().add(x, "d");
|
||||
grid.push({
|
||||
date: moment_date,
|
||||
create_default_date: moment_date.format("YYYY-MM-DD"),
|
||||
date_label: moment_date.format("dd") + " " + moment_date.format("ll"),
|
||||
plan_entries: this.plan_items.filter(
|
||||
(m) =>
|
||||
moment_date.isBetween(
|
||||
moment(m.startDate),
|
||||
moment(m.endDate),
|
||||
'day',
|
||||
'[]'
|
||||
)
|
||||
),
|
||||
});
|
||||
}
|
||||
return grid
|
||||
return grid;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<link rel="stylesheet" type="text/css" href="print.css" media="print">
|
||||
<div class="dropdown d-print-none">
|
||||
<a class="btn shadow-none pr-0 pl-0" href="javascript:void(0);" role="button" id="dropdownMenuLink"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
6
vue/src/components/print.css
Normal file
6
vue/src/components/print.css
Normal file
@ -0,0 +1,6 @@
|
||||
@media print {
|
||||
body {
|
||||
color: black; /* Set text color to black */
|
||||
background: white; /* Set background color to white */
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user