Sanity Date Schema - How to Set a Date for a Document
Last updated: Apr 6, 2021
Hey all~A little strange thing... I am using the snaity date schema type to set the date for one of my documents... When I type it a date (yyyy-mm-dd) or use the calendar UI date picker... it always sets it to the day before. If i type or select 2021-03-09 then the date showing on my screen in the field would be 2021-03-08? Strange... here are my sanity versions that I am using
@sanity/cli 2.7.1 (up to date)
@sanity/base 2.7.1 (up to date)
@sanity/color-input 2.2.6 (up to date)
@sanity/components 2.2.6 (up to date)
@sanity/core 2.7.1 (up to date)
@sanity/dashboard 2.7.0 (up to date)
@sanity/default-layout 2.7.1 (up to date)
@sanity/default-login 2.7.0 (up to date)
@sanity/desk-tool 2.7.1 (up to date)
@sanity/vision 2.7.0 (up to date)
Mar 26, 2021, 6:02 PM
Here is an image of the studio showing the date picker
Mar 26, 2021, 6:03 PM
You think this is a timezone issue?
Mar 26, 2021, 6:30 PM
maybe... i'm in the EDT i know that used to have to adjust it when i get the date out of sanity due to the time difference...
Mar 26, 2021, 8:12 PM
Pretty sure they updated the date picker the other day. If it's a bug they now ask people to submit an issue to the GitHub repo.