Browse Source

FE: Messages: Fix UI displays nonsensical timestamps(#3715)

David Bejanyan 2 years ago
parent
commit
f6fe14cea5
1 changed files with 1 additions and 2 deletions
  1. 1 2
      kafka-ui-react-app/src/lib/dateTimeHelpers.ts

+ 1 - 2
kafka-ui-react-app/src/lib/dateTimeHelpers.ts

@@ -1,6 +1,6 @@
 export const formatTimestamp = (
 export const formatTimestamp = (
   timestamp?: number | string | Date,
   timestamp?: number | string | Date,
-  format: Intl.DateTimeFormatOptions = { hour12: false }
+  format: Intl.DateTimeFormatOptions = { hourCycle: 'h23' }
 ): string => {
 ): string => {
   if (!timestamp) {
   if (!timestamp) {
     return '';
     return '';
@@ -8,7 +8,6 @@ export const formatTimestamp = (
 
 
   // empty array gets the default one from the browser
   // empty array gets the default one from the browser
   const date = new Date(timestamp);
   const date = new Date(timestamp);
-
   // invalid date
   // invalid date
   if (Number.isNaN(date.getTime())) {
   if (Number.isNaN(date.getTime())) {
     return '';
     return '';