From 4820d87d8656db845d18a22c0ad048a678059522 Mon Sep 17 00:00:00 2001 From: Arjan Singh Date: Wed, 17 Sep 2025 12:31:32 -0700 Subject: [PATCH] [fix] use i18n utility for dates --- src/i18n.ts | 2 +- src/platform/assets/composables/useAssetBrowser.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i18n.ts b/src/i18n.ts index 2544fc7eb..29d55f783 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -71,7 +71,7 @@ export const i18n = createI18n({ }) /** Convenience shorthand: i18n.global */ -export const { t, te } = i18n.global +export const { t, te, d } = i18n.global /** * Safe translation function that returns the fallback message if the key is not found. diff --git a/src/platform/assets/composables/useAssetBrowser.ts b/src/platform/assets/composables/useAssetBrowser.ts index 22af0cf4e..964c81fc7 100644 --- a/src/platform/assets/composables/useAssetBrowser.ts +++ b/src/platform/assets/composables/useAssetBrowser.ts @@ -1,6 +1,6 @@ import { computed, ref } from 'vue' -import { t } from '@/i18n' +import { d, t } from '@/i18n' import type { UUID } from '@/lib/litegraph/src/utils/uuid' import type { AssetItem } from '@/platform/assets/schemas/assetSchema' import { @@ -69,7 +69,7 @@ export function useAssetBrowser(assets: AssetItem[] = []) { // Create display stats from API data const stats = { - formattedDate: new Date(asset.created_at).toLocaleDateString(), + formattedDate: d(new Date(asset.created_at), { dateStyle: 'short' }), downloadCount: undefined, // Not available in API stars: undefined // Not available in API }