Support custom format in getTimeago
What does this MR do and why?
This MR adds support for custom date and time formats for getTimeago
utility function, which respects the user preference (whether to use relative or absolute time) and respects browser locale.
In order to match the desired mockups in Security Policies table, we need to be able to only display the date portion, while still respecting the user preference.
Screenshots or screen recordings
Before:
After, with en-US
locale:
With en-GB
locale:
With "Use relative times" enabled:
Tooltips with absolute datetime:
Tooltips with relative datetime:
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Under http://gdk.test:3000/-/profile/preferences, disable "Use relative times"
- Go to Security & Compliance -> Policies
- (optional) Create any policy if there's no data
- Different locale can be tested with Locale Switcher browser extension
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #345244 (closed)