From 83ac1a8e5a5a07d6487a5dcc7ca6e82b9f84dfee Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 1 Jun 2025 14:39:13 +0530 Subject: [PATCH] use: timestamps for `datetime` attribute. --- src/lib/components/dualTimeView.svelte | 6 +++- .../collection-[collection]/table.svelte | 29 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/lib/components/dualTimeView.svelte b/src/lib/components/dualTimeView.svelte index 2c3271b02..810e8e50f 100644 --- a/src/lib/components/dualTimeView.svelte +++ b/src/lib/components/dualTimeView.svelte @@ -97,7 +97,11 @@ - {timeToString} + {#if $$slots.title} + + {:else} + {timeToString} + {/if} diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte index dbdb5ec41..6b9c32b08 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte @@ -25,6 +25,7 @@ FloatingActionBar, Typography } from '@appwrite.io/pink-svelte'; + import { toLocaleDateTime } from '$lib/helpers/date'; import DualTimeView from '$lib/components/dualTimeView.svelte'; export let data: PageData; @@ -244,17 +245,23 @@ {/if} {:else} {@const formatted = formatColumn(document[id])} - - - {formatted.value} - - - {formatted.whole} - - + {@const isDatetimeAttribute = attr.type === 'datetime'} + {#if isDatetimeAttribute} + + Timestamp + {toLocaleDateTime(formatted.whole, true, 'UTC')} + + {:else} + + {formatted.value} + + {formatted.whole} + + + {/if} {/if} {/each}