summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/component/workspace/common.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/app/src/component/workspace/common.tsx')
-rw-r--r--packages/console/app/src/component/workspace/common.tsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/console/app/src/component/workspace/common.tsx b/packages/console/app/src/component/workspace/common.tsx
new file mode 100644
index 000000000..f85fd8423
--- /dev/null
+++ b/packages/console/app/src/component/workspace/common.tsx
@@ -0,0 +1,25 @@
+export function formatDateForTable(date: Date) {
+ const options: Intl.DateTimeFormatOptions = {
+ day: "numeric",
+ month: "short",
+ hour: "numeric",
+ minute: "2-digit",
+ hour12: true,
+ }
+ return date.toLocaleDateString("en-GB", options).replace(",", ",")
+}
+
+export function formatDateUTC(date: Date) {
+ const options: Intl.DateTimeFormatOptions = {
+ weekday: "short",
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+ hour: "numeric",
+ minute: "2-digit",
+ second: "2-digit",
+ timeZoneName: "short",
+ timeZone: "UTC",
+ }
+ return date.toLocaleDateString("en-US", options)
+}