Skip to content
Snippets Groups Projects
Unverified Commit 75f2dc1a authored by Mark Bastian's avatar Mark Bastian Committed by GitHub
Browse files

Formatting for time types (#37942)


* Formatting for time types

Currently, the frontend does not do any special formatting for time of day types. These are always formatted as 12 hour AM/PM times. This PR adds a new function to `frontend/src/metabase/lib/formatting/time.ts`, `formatTimeWithOptions`, that applies user-defined formatting to the time. Previously, `formatTime` was called, which takes no formatting options, so none can be applied.

Fixes #11398

* e2e tests for time of day formatting.

* Update frontend/src/metabase/lib/formatting/time.ts

Co-authored-by: default avatarEmmad Usmani <emmadusmani@berkeley.edu>

* Replacing formatTime with formatTimeWithOptions

This replaces uses of `formatTime` with `formatTimeWithOptions`, updates unit tests, removes references to `formatTime`, and incorporates some code suggestions.

* Unit tests

* Adding test id for field info popover.

* Refactoring `formatTimeWithOptions` to `formatTime`

* Moved `TimeOnlyOptions` interface to formatting types and made it an ancestor of `OptionsType`

---------

Co-authored-by: default avatarEmmad Usmani <emmadusmani@berkeley.edu>
parent dbb4cc7d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment