-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
UTC Date shows correct data in admin form, but one day earlier in admin list #4840
Comments
Here's a pull request for this issue: https://github.com/keystonejs/keystone/pull/4841 I have verified that this is working correctly for me in a production setting where my server is in a different timezone that my client machine and also running locally. I implemented the same moment.utc() formatting pattern present in DateField.js for consistency. The only difference is the property that's accessed to check for |
@alsoicode, if you're interested in working with me on shoring up additional date issues, let me know, I have a few I'm planning on working on from formatting to handling a missing default, to UTC within Relationship fields referencing a model. Regardless, thanks for your help on this issue. |
Sure, I'd love to help. I'm very busy on a project for work this week, as it's the last week of our current sprint, but I might be able to make some time in the evening. Are there existing issues for the things you want to work on you could point me to? |
thanks @alsoicode, the things I noticed were date formats not being respected in disabled fields, date formats not being configurable when filtering, date formats not being configurable for the list view, and an incorrect date being assigned with the 'today' button after a certain time. I need to create issues for a few, and honestly, I'm in a similar boat with having limited time, but why don't we connect either via email (mine is [email protected]), or via Slack and hopefully we can figure out time to collaborate. Thanks for the willingness to help, it's appreciated. |
Sure. My email is [email protected]. I've been using Keystone for quite a while, so it's nice to be able to give back. |
How did you fix this issue? Mine is giving 2 days back from the real date selected in form, and save into the db. In the Admin list and also Admin item the problem persist, I've tried hacky solutions like save the date in plain text and using moment.js with Keystone hooks but I'd like to come with a more clean solution. @alsoicode @autoboxer |
@ytzvan What version of Keystone 4 are you using? I'm using 4.2.1 for an older project and specifying |
@alsoicode I'm using also Keystone 4.2.1, I just even change my PROD server timezone to use GMT instead of UTC, before the data shows 2 days earlier, now is only 1 day earlier, I'll check your suggest. |
Expected behavior
A Date field stored in UTC time should show the same value in the model list view and when editing
Actual/Current behavior
Keystone admin shows the correct value for a Date field with the
utc: true
option set, but after saving, the list will display the date one day early.Steps to reproduce the actual/current behavior
Create a model with a
Date
field and theutc: true
option enabled.Save an instance of your model.
Environment
The text was updated successfully, but these errors were encountered: