1
0
Fork 0
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:
Mario Džoić 2025-07-18 21:40:35 +02:00 committed by GitHub
parent 2731fb4a01
commit 3a1f58037d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(),