mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	fix: Fix RecipeLastMade dialog date picker being off by a day (#6079)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							0883ef05ab
						
					
				
				
					commit
					3361f9a7c3
				
			| @@ -119,6 +119,7 @@ | |||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { whenever } from "@vueuse/core"; | import { whenever } from "@vueuse/core"; | ||||||
|  | import { formatISO } from "date-fns"; | ||||||
| import { useUserApi } from "~/composables/api"; | import { useUserApi } from "~/composables/api"; | ||||||
| import { alert } from "~/composables/use-toast"; | import { alert } from "~/composables/use-toast"; | ||||||
| import { useHouseholdSelf } from "~/composables/use-households"; | import { useHouseholdSelf } from "~/composables/use-households"; | ||||||
| @@ -148,7 +149,7 @@ const newTimelineEventImageName = ref<string>(""); | |||||||
| const newTimelineEventImagePreviewUrl = ref<string>(); | const newTimelineEventImagePreviewUrl = ref<string>(); | ||||||
| const newTimelineEventTimestamp = ref<Date>(new Date()); | const newTimelineEventTimestamp = ref<Date>(new Date()); | ||||||
| const newTimelineEventTimestampString = computed(() => { | const newTimelineEventTimestampString = computed(() => { | ||||||
|   return newTimelineEventTimestamp.value.toISOString().substring(0, 10); |   return formatISO(newTimelineEventTimestamp.value, { representation: "date" }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| const lastMade = ref(props.recipe.lastMade); | const lastMade = ref(props.recipe.lastMade); | ||||||
| @@ -169,7 +170,7 @@ whenever( | |||||||
|   () => madeThisDialog.value, |   () => madeThisDialog.value, | ||||||
|   () => { |   () => { | ||||||
|     // Set timestamp to now |     // Set timestamp to now | ||||||
|     newTimelineEventTimestamp.value = new Date(Date.now() - new Date().getTimezoneOffset() * 60000); |     newTimelineEventTimestamp.value = new Date(); | ||||||
|   }, |   }, | ||||||
| ); | ); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user