Establish date formatting conventions in charts
We don't currently have much of a convention about how dates/times are rendered in our charts. This is relevant in axes, and also tooltips (and possibly other places).
At the moment, it seems this is left up to the consumer to configure, which leads to inconsistency across the application, as discussed gitlab!21916 (comment 263238343) and gitlab!21916 (comment 263290294).
For instance, we already have two separate, but different date formatting definitions in GitLab:
- app/assets/javascripts/monitoring/constants.js#L95-103
- ee/app/assets/javascripts/analytics/shared/constants.js#L1-5
Ideally, the chart components that gitlab-ui provides would infer the types of data being provided, and use the relevant built-in formatters.
Perhaps as a first iteration, gitlab-ui could simply define common date formatters and export them, so consuming applications can configure their charts with them. What those default date formats should be, and where/when they're used, should probably be a UX decision.
How this should be done more generally (i.e., using convention over configuration) should perhaps also be tackled with #461 in mind.