RFC: Reevaluate time related fields
See original GitHub issueCurrently start_at
and end_at
timestamps do not record a timezone. We ask, and rely on, editors of cms.artsy.net, admin-fairs.artsy.net and auctions.artsy.net to input timestamps offset by UTC. E.g. if an auction is starting at 12pm Hong Kong Standard Time (GMT+8) we enter the time offset by 8 hours, 2019-11-01T04:00:00+00:00
.
This has worked fine for Auctions, as Artsy’s auction team know to offset the time using a third party site. However, when Partners and other editors enter the time into the input in admin-fairs.artsy.net and cms.artsy.net it is often unclear or laborious and the content is entered incorrectly.
I’m proposing that we add a timezone selection to cms.artsy.net, admin-fairs.artsy.net and auctions.artsy.net datetime inputs to correctly record timestamps and to also make the content entry easier and explicit. I’m also proposing we add a new set of guidelines, or perhaps a design system, to outline the ways different models display time.
To make this transition seamless I’m proposing these steps:
-
The current
start_at
andend_at
dates in Metaphysics should have their timezone data stripped and returned as+00:00
, i.e.2019-11-01T04:00:00+05:00
→2019-11-01T04:00:00+00:00
, so to always return this timestamp with it’s original+00:00
, in preparation for updating Gravity with timezones. -
Run a migration that updates Gravity’s current timestamps stamped with a timezone based on the partner or galleries current timezone based on location, i.e.
2019-11-01T04:00:00+00:00
→2019-11-01T04:00:00+05:00
. -
Create new
startAt
andendAt
fields in metaphysics that return the timestamp with encoded timezone in ISO 8601 format, setting us up to slowly deprecate the snake_case variants. -
Create guidelines for returning text fields created in Metaphysics instead of using ISO 8601 timestamps in client applications. These could potentially live in Palette. E.g. for fair and show model we can return
formattedOpeningHours
as “Opens Mar 29 at 4:00pm” instead of formatting the timestamp in the client. A notion doc has been started on this subject: https://www.notion.so/artsy/Formatting-Time-f6f4aaeeba414583a207013fec5a9794
This is not just a backend change, but also a holistic overview for how and where we’re using time. In many cases we want to use time relative to a place, a fair should perhaps always show “Opens Mar 29 at 4:00pm,” no matter where the user is viewing from. An auction may need to show “Starts Mar 29 at 4:00pm EST” and be dynamic based on the users’ location. Through creating a system of guidelines and setting up metaphysics to handle most (or perhaps all) of our date formatting, we can make these use cases explicit in perpetuity.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (18 by maintainers)
Top GitHub Comments
Notes from meeting from today:
Product Desires:
Tech perspective:
Proof of concept:
(1) adding UI for partner show events in cms.artsy.net (2) change kinetic / add validations / gravity to ensure that this date time always have a paired timezone
—
(3) Make Metaphysics source of truth for any date/time/range formatting (4) Update clients of Metaphysics to use the new MP fields
Order of events:
[Kieran & Owen]: Audit current needs for time stuff, implement some new fields in metaphysics which reflect those needs
Document requirements in Notion, spike on Metaphysics field implementations.
[Roop]: Do the audit.
regroup first of May to review spike with Kieran.
We’ll be starting this effort with
PartnerShowEvents
(e.g. opening receptions), and what you suggest is exactly the plan. These should have an associated location, and thereby a timezone, which we can display to the user with the option to override.(
PartnerShowEvent
⤚PartnerShow
⤚PartnerLocation
)