We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afa2963 commit 180fcb0Copy full SHA for 180fcb0
devtools/frontend/src/components/LogWindow.tsx
@@ -1,11 +1,22 @@
1
import { forwardRef } from "react";
2
import * as css from "./LogWindow.css";
3
4
-const formatDate = (date: Date) => {
5
- return Intl.DateTimeFormat(undefined, {
6
- timeStyle: "medium",
7
- }).format(date);
8
-};
+function formatDate(date: Date) {
+ let p = new Intl.DateTimeFormat("en", {
+ year: "numeric",
+ month: "2-digit",
+ day: "2-digit",
9
+ hour: "2-digit",
10
+ minute: "2-digit",
11
+ })
12
+ .formatToParts(date)
13
+ .reduce((acc: any, part) => {
14
+ acc[part.type] = part.value;
15
+ return acc;
16
+ }, {});
17
+
18
+ return `${p.year}.${p.month}.${p.day} ${p.hour}:${p.minute} ${p.}`;
19
+}
20
21
const LogWindow = forwardRef<HTMLDivElement>((props, ref) => {
22
const logs = [
0 commit comments