From dd31dcaff7d6403443dcb22f1044af92c234e520 Mon Sep 17 00:00:00 2001 From: Martina Pippi Date: Mon, 4 Mar 2024 16:09:33 +0100 Subject: [PATCH] add datetimeFormats i18n --- src/components/general/DateTimeSlider.vue | 5 ++- .../time-control/IntervalSelector.vue | 21 +++++++---- .../time-control/TimeControlMenu.vue | 28 ++++++--------- src/locales/en.json | 6 ++++ src/locales/index.ts | 35 +++++++++++++++++++ src/locales/nl.json | 6 ++++ src/plugins/i18n.ts | 3 +- 7 files changed, 79 insertions(+), 25 deletions(-) diff --git a/src/components/general/DateTimeSlider.vue b/src/components/general/DateTimeSlider.vue index 85cccd223..41b7c56a3 100644 --- a/src/components/general/DateTimeSlider.vue +++ b/src/components/general/DateTimeSlider.vue @@ -106,6 +106,7 @@ import { findDateIndex } from '@/lib/utils/findDateIndex' import VueSlider from 'vue-slider-component' import 'vue-slider-component/theme/antd.css' +import { useI18n } from 'vue-i18n' interface Properties { selectedDate?: Date @@ -139,6 +140,7 @@ const doFollowNow = ref(props.doFollowNow) let followNowIntervalTimer: ReturnType | null = null const hideLabel = ref(true) +const { d } = useI18n() onMounted(() => { if (props.doFollowNow) { @@ -245,7 +247,8 @@ const playButtonColor = computed(() => const dateString = computed(() => props.dates[dateIndex.value] - ? props.dates[dateIndex.value].toLocaleString() + ? // ? props.dates[dateIndex.value].toLocaleString() + d(props.dates[dateIndex.value], 'datetimeslider') : '', ) diff --git a/src/components/time-control/IntervalSelector.vue b/src/components/time-control/IntervalSelector.vue index 0a72753ae..6ce07cd1a 100644 --- a/src/components/time-control/IntervalSelector.vue +++ b/src/components/time-control/IntervalSelector.vue @@ -1,7 +1,10 @@