Page MenuHomePhabricator

MPIC: Consistently represent dates/times internally
Closed, ResolvedPublic5 Estimated Story Points

Description

Background

During T377826: MPIC: UI improvements for the catalog table, we found that at least the start_date and end_date fields of an instrument (or A/B test) are stored as strings in the frontend. To improve flexibility (date comparison in JavaScript uses mathematical operators) and localisability, we should represent them using the Date class.

Proposal

  • Represent dates as strings in ISO 8601 format in the API
  • When an API response is received, construct a new instance of Date from the string
  • When a new instrument is being constructed:
    • Set the start_date property to a new Date instance; and
    • Set the end_date property to a Date instance representing the date that the user selected
  • Use Date.toLocaleDateString() (UTC everywhere all at once) to render dates whenever they need to be shown to the user

Event Timeline

Change #1105431 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[operations/deployment-charts@master] Metrics Platform Instrument Configuration: Deploying to staging

https://gerrit.wikimedia.org/r/1105431

Change #1105433 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[operations/deployment-charts@master] Metrics Platform Instrument Configuration: Deploying to production

https://gerrit.wikimedia.org/r/1105433

Change #1105431 merged by jenkins-bot:

[operations/deployment-charts@master] Metrics Platform Instrument Configuration: Deploying to staging

https://gerrit.wikimedia.org/r/1105431

Change #1105433 merged by jenkins-bot:

[operations/deployment-charts@master] Metrics Platform Instrument Configuration: Deploying to production

https://gerrit.wikimedia.org/r/1105433

Change #1107981 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/extensions/MetricsPlatform@master] Update start_date to utc_start_dt

https://gerrit.wikimedia.org/r/1107981

Change #1107981 merged by jenkins-bot:

[mediawiki/extensions/MetricsPlatform@master] Update start_date to utc_start_dt

https://gerrit.wikimedia.org/r/1107981