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>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
{% if request.user.userpreference.left_handed %}
|
{% if request.user.userpreference.left_handed %}
|
||||||
{% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %}
|
{% 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' %}"
|
<a class="navbar-brand p-0 me-2 justify-content-center" href="{% base_path request 'base' %}"
|
||||||
|
@ -363,20 +363,26 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mobileSimpleGrid() {
|
mobileSimpleGrid() {
|
||||||
let grid = []
|
let grid = [];
|
||||||
|
let currentDate = moment();
|
||||||
if (this.current_period !== null) {
|
for (let x = 0; x < 7; x++) {
|
||||||
for (const x of Array(7).keys()) {
|
let moment_date = currentDate.clone().add(x, "d");
|
||||||
let moment_date = moment(this.current_period.periodStart).add(x, "d")
|
grid.push({
|
||||||
grid.push({
|
date: moment_date,
|
||||||
date: moment_date,
|
create_default_date: moment_date.format("YYYY-MM-DD"),
|
||||||
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"),
|
||||||
date_label: moment_date.format("dd") + " " + moment_date.format("ll"),
|
plan_entries: this.plan_items.filter(
|
||||||
plan_entries: this.plan_items.filter((m) => moment_date.isBetween(moment(m.startDate), moment(m.endDate), 'day', '[]'))
|
(m) =>
|
||||||
})
|
moment_date.isBetween(
|
||||||
}
|
moment(m.startDate),
|
||||||
|
moment(m.endDate),
|
||||||
|
'day',
|
||||||
|
'[]'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return grid
|
return grid;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<link rel="stylesheet" type="text/css" href="print.css" media="print">
|
||||||
<div class="dropdown d-print-none">
|
<div class="dropdown d-print-none">
|
||||||
<a class="btn shadow-none pr-0 pl-0" href="javascript:void(0);" role="button" id="dropdownMenuLink"
|
<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">
|
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