-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Labels
featureNew feature or requestNew feature or request
Milestone
Description
Currently, if I set a field to the date
type and enter a partial date, e.g., 2021-10-21
I'm given a date object initialized with a value in UTC, like this 2021-10-21T00:00:00.000Z
. Ideally I'd be able to have that partial date interpreted correctly for my timezone — I'm in America/New_York
so I'd like to see 2021-10-21T04:00:00.000Z
.
A possible, straightforward solution would be the date-fns-tz
libraries zonedTimeToUtc
function and an optional IANA timezone in the contentlayer config. E.g.
zonedTimeToUtc(doc.createdAt, opts.timezone)
If you're interested in a contribution I could work on a PR.
schickling
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request