From 557b1ec8475c6348291d0568c70e7a434f10c071 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 12 Apr 2024 21:15:54 +0200 Subject: [PATCH] fix(NcDateTime): When relative time is disabled return a string and not the reference to it The `.value` call was missing in case of disabled relative time. This causes the string to be quoted (because of stringification of the computed value). To prevent similar issues the file is now migrated to Typescript, also fixed some other issues discovered by type checking. Signed-off-by: Ferdinand Thiessen --- src/components/NcDateTime/NcDateTime.vue | 5 +- src/composables/index.js | 2 +- ...FormatDateTime.js => useFormatDateTime.ts} | 52 +++++++++++++------ .../composables/useFormatDateTime.spec.js | 2 +- vite.config.mts | 4 +- 5 files changed, 44 insertions(+), 21 deletions(-) rename src/composables/{useFormatDateTime.js => useFormatDateTime.ts} (74%) diff --git a/src/components/NcDateTime/NcDateTime.vue b/src/components/NcDateTime/NcDateTime.vue index 9946007a52..1d9cf46275 100644 --- a/src/components/NcDateTime/NcDateTime.vue +++ b/src/components/NcDateTime/NcDateTime.vue @@ -109,12 +109,13 @@ h4 {