Use absolute time format for policy list
Background
We have updated the document for date and time form in Pajamas. According to the guideline, we only use the relative time either user set it up or Content is updated frequently and specifics are not critical. For example, a live newsfeed or notification.
Action needed
For the policy area, we don't expect users to update policies very often, definitely not daily. So it suits for an absolute time instead of a relative time.
The rules:
- if (the user doesn't set up any preference && we can detect users' browser's setting )-> absolute localized format
- if (the user doesn't set up any preference && we can NOT detect users' browser's setting)-> absolute ISO 8601 format
- if (the user does set up any preference)-> use users' preference
| Old | New |
|---|---|
![]() |
![]() |
Implementation
-
frontend Update policies_list.vue#getTimeAgoString method to return the correct time using formatDate
Verification steps
- Go to
Security & Compliance -> Policies(example) - The column
Last modifiedshould relative time shown by default and have a tooltip on mouseover - Under
-/profile/preferences, disable "Use relative times" - Go back to the policies list
- The column
Last modifiedshould show absolute dates without the time. Tooltip should still contain the time information together with the timezone.
Edited by Martin Cavoj

