From 3fbb45c9e4c2f08d454b7fbd1a2d28149295c497 Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Tue, 16 Apr 2024 11:55:51 -0700 Subject: [PATCH 1/8] convert date cell to single line --- app/table/columns/common.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/table/columns/common.tsx b/app/table/columns/common.tsx index 727268463b..c8212c6d62 100644 --- a/app/table/columns/common.tsx +++ b/app/table/columns/common.tsx @@ -12,7 +12,6 @@ import { filesize } from 'filesize' import { Truncate } from '~/ui/lib/Truncate' import { EmptyCell } from '../cells/EmptyCell' -import { TwoLineCell } from '../cells/TwoLineCell' // the full type of the info arg is CellContext from RT, but in these // cells we only care about the return value of getValue @@ -20,7 +19,12 @@ type Info = { getValue: () => T } function dateCell(info: Info) { const date = info.getValue() - return + return ( + + {format(date, 'MMM d, yyyy')} + {format(date, 'p')} + + ) } function sizeCell(info: Info) { From 0a826758a9e4f69c077695d8194df48a53568ad2 Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Tue, 16 Apr 2024 12:41:26 -0700 Subject: [PATCH 2/8] use html5 time element as wrapper --- app/table/columns/common.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/table/columns/common.tsx b/app/table/columns/common.tsx index c8212c6d62..4001670d9c 100644 --- a/app/table/columns/common.tsx +++ b/app/table/columns/common.tsx @@ -6,6 +6,7 @@ * Copyright Oxide Computer Company */ +import { formatISO } from 'date-fns' import { format } from 'date-fns/format' import { filesize } from 'filesize' @@ -20,10 +21,10 @@ type Info = { getValue: () => T } function dateCell(info: Info) { const date = info.getValue() return ( - - {format(date, 'MMM d, yyyy')} + + ) } From 99f578fae5430a9ad372ec8e504b53502aaaceea Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Tue, 16 Apr 2024 13:02:50 -0700 Subject: [PATCH 3/8] use native toISOString --- app/table/columns/common.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/table/columns/common.tsx b/app/table/columns/common.tsx index 4001670d9c..4d16943986 100644 --- a/app/table/columns/common.tsx +++ b/app/table/columns/common.tsx @@ -6,7 +6,6 @@ * Copyright Oxide Computer Company */ -import { formatISO } from 'date-fns' import { format } from 'date-fns/format' import { filesize } from 'filesize' @@ -21,7 +20,7 @@ type Info = { getValue: () => T } function dateCell(info: Info) { const date = info.getValue() return ( -