-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date field is getting timezoned #5734
Comments
We completely remove the concept of timezone for I definitely need a working example with server, user and browser timezone. |
I have this issue just reported to me, depending where the user is in the world and time of day they see a different date when editing. If I load my edit page: My current timezone is Europe/London date shows 22/07/2023 (22nd July 2023) User in Pacific/Pago_Pago who are now on the next day at time of this message, see 21/07/2023 They should see 22/07/2023 as that's the date thats stored in the database there shouldn't be any timezone conversion happening with dates. I think like DateTime field we need to set the timezone when setting the Date in Date field So if we create the value in the Vue component with the timezone that nova is set to, Pacific/Pago_Pago user now sees 22/07/2023 in edit page this.value = DateTime.fromISO(this.currentField.value || this.value, {
zone: Nova.config('timezone'),
}).toISODate() |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
When I look at a date field on the details and edit page from a computer in the US, it shifts the actual date to the previous date.
E.g. I have '2023-07-18' in the database under the field with DATE type.
It will show me "07/17/2023" on the details page.
I will also populate "07/17/2023" if I edit the model.
I guess what happens is, Details/DateField.vue takes the date, converts it to datetime, and then localizes it to the string, and then 2023-07-18 00:00:00 UTC becomes something like 2023-07-17 16:00:00 Pacific Time. So it then shows 2023-07-17.
Similar thing happens with in Form/DateField.vue with luxon:
I don't think Date field should localized the date at all, because a date is a date.
Detailed steps to reproduce the issue on a fresh Nova installation:
The text was updated successfully, but these errors were encountered: