mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
fix timezone bug in recipe mealplan dialog
This commit is contained in:
parent
5c81f1fabf
commit
a099c87500
1 changed files with 6 additions and 2 deletions
|
@ -269,13 +269,17 @@ export default defineNuxtComponent({
|
||||||
recipeName: props.name,
|
recipeName: props.name,
|
||||||
loading: false,
|
loading: false,
|
||||||
menuItems: [] as ContextMenuItem[],
|
menuItems: [] as ContextMenuItem[],
|
||||||
newMealdate: new Date(Date.now() - new Date().getTimezoneOffset() * 60000),
|
newMealdate: new Date(),
|
||||||
newMealType: "dinner" as PlanEntryType,
|
newMealType: "dinner" as PlanEntryType,
|
||||||
pickerMenu: false,
|
pickerMenu: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const newMealdateString = computed(() => {
|
const newMealdateString = computed(() => {
|
||||||
return state.newMealdate.toISOString().substring(0, 10);
|
// Format the date to YYYY-MM-DD in the same timezone as newMealdate
|
||||||
|
const year = state.newMealdate.getFullYear();
|
||||||
|
const month = String(state.newMealdate.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(state.newMealdate.getDate()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue