瀏覽代碼

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

David Bejanyan 2 年之前
父節點
當前提交
f6fe14cea5
共有 1 個文件被更改,包括 1 次插入2 次删除
  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 = (
   timestamp?: number | string | Date,
-  format: Intl.DateTimeFormatOptions = { hour12: false }
+  format: Intl.DateTimeFormatOptions = { hourCycle: 'h23' }
 ): string => {
   if (!timestamp) {
     return '';
@@ -8,7 +8,6 @@ export const formatTimestamp = (
 
   // empty array gets the default one from the browser
   const date = new Date(timestamp);
-
   // invalid date
   if (Number.isNaN(date.getTime())) {
     return '';