mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 13:35:23 +02:00
fix: meal planner date range is correctly set (#5725)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
parent
2731fb4a01
commit
3a1f58037d
1 changed files with 5 additions and 9 deletions
|
@ -115,15 +115,11 @@ export default defineNuxtComponent({
|
|||
const weekRange = computed(() => {
|
||||
const sorted = [...state.value.range].sort((a, b) => a.getTime() - b.getTime());
|
||||
|
||||
if (sorted.length === 2) {
|
||||
return {
|
||||
start: sorted[0],
|
||||
end: sorted[1],
|
||||
};
|
||||
// return {
|
||||
// start: parseYYYYMMDD(sorted[0]),
|
||||
// end: parseYYYYMMDD(sorted[1]),
|
||||
// };
|
||||
const start = sorted[0];
|
||||
const end = sorted[sorted.length - 1];
|
||||
|
||||
if (start && end) {
|
||||
return { start, end };
|
||||
}
|
||||
return {
|
||||
start: new Date(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue