Bug 1862084

Summary: Inconsistency of time formats in the OpenShift web-console
Product: OpenShift Container Platform Reporter: Kaushal Sathe <ksathe>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: high Docs Contact:
Priority: high    
Version: 4.4CC: amobrem, anpicker, aos-bugs, jhadvig, jokerman, jscalf, nchoudhu, ralpert, rdey, rpalathi, spadgett, yapei
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Fixed an issue where the OpenShift console would use inconsistent time formats in different areas in the UI. Previously, the console would show 12 hour format in most places, and 24 hour format in others. The dates and times are now formatted consistently using the user's locale and language preference. Fixed an issue where the year was not displayed for dates more than a year in the past.
Story Points: ---
Clone Of:
: 1952209 (view as bug list) Environment:
Last Closed: 2021-07-27 22:32:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1952209    

Description Kaushal Sathe 2020-07-30 12:02:16 UTC
Description of problem:

In the OpenShift web-console there is an inconsistency in the time formats shown in the "Overview -- Status" (time format = am/pm) and "Overview -- Activity" (time format = 24 hours) sections.


Version-Release number of selected component (if applicable):
OpenShift version 4.x. However I checked it in 4.3.29 as well as 4.4.12.

How reproducible:
Always

Actual results:
Time format inconsistency

Expected results:
Both the time formats should be same. Either am/pm format or 24 hours format.

Comment 7 Jakub Hadvig 2020-12-23 16:15:42 UTC
We did not have time to fix this issue this sprint. Will reevaluate and try to fix in next sprint.

Comment 8 Rastislav Wagner 2021-01-04 10:13:35 UTC
@jhadvig @spadgett which time format do we want to use ? We use mostly am/pm format but charts and overview events card are using 24hrs.

Comment 9 Samuel Padgett 2021-01-04 19:23:06 UTC
I'd generally suggest am/pm unless there's not enough room to make it fit. Probably we should use the `short` format from `Intl.DateTimeFormat` so it's formatted for the user's locale.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat

Comment 10 Samuel Padgett 2021-01-04 19:26:30 UTC
Or perhaps moment.js localized format `LT`

https://momentjs.com/docs/#/displaying/format/

Comment 12 Samuel Padgett 2021-03-22 13:34:49 UTC
There is a related fix in https://github.com/openshift/console/pull/8365 where we localize the time formats for the query browser.

Comment 17 Samuel Padgett 2021-04-16 13:47:07 UTC
*** Bug 1948892 has been marked as a duplicate of this bug. ***

Comment 18 Samuel Padgett 2021-04-16 15:28:41 UTC
*** Bug 1930444 has been marked as a duplicate of this bug. ***

Comment 19 Yadan Pei 2021-04-19 06:12:49 UTC
1. Cluster Setting page 'Update history' table shows Completed time with format: Date, Year, Time(im AM/PM format), such as Apr 19, 2021, 7:50 AM
2. Home -> Overview -> Status shows alerts with format: Date, Year, Time(im AM/PM format), such as Apr 19, 2021, 9:53 AM
3. Home -> Overview -> Events also shows events with format: Time(in AM/PM format), such as 9:58 AM
4. For projects creation date, node creation date, we use format: Date, Year, Time(im AM/PM format), such as Apr 19, 2021, 7:34 AM with Year included

It looks like every place is using consistent time format and working as expected. 

Going to move the bug to VERIFIED, this is checked against 4.8.0-0.nightly-2021-04-18-101412

Comment 29 errata-xmlrpc 2021-07-27 22:32:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438