From 2427ec275a199e9392511bd9f502fae8e6b2d106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Besnard?= <bbesnard@clever-age.com> Date: Fri, 21 Jan 2022 11:32:11 +0100 Subject: [PATCH] Fix time format --- components/navigation/menu/Sidebar.vue | 2 +- i18n/locales/dateTimeFormats.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/navigation/menu/Sidebar.vue b/components/navigation/menu/Sidebar.vue index 67472f9..2b837b1 100644 --- a/components/navigation/menu/Sidebar.vue +++ b/components/navigation/menu/Sidebar.vue @@ -7,7 +7,7 @@ </nuxt-link> <div class="d-flex text-info justify-content-between align-items-baseline mt-3 mx-2"> <div class="">v0.02</div> - <div class="small" v-if="countMax">Bloc n°<span class="font-weight-bold">{{ countMax.number }}</span> ({{ $d(new Date(countMax.utc0*1000), 'short') }} {{ $t('time.a') }} {{ $d(new Date(countMax.utc0*1000), 'hour') }}{{ $d(new Date(countMax.utc0*1000), 'min') }})</div> + <div class="small" v-if="countMax">Bloc n°<span class="font-weight-bold">{{ countMax.number }}</span> ({{ $d(new Date(countMax.utc0*1000), 'short') }} {{ $t('time.a') }} {{ $d(new Date(countMax.utc0*1000), 'time') }})</div> </div> <button type="button" class="close position-absolute d-xl-none" aria-label="Close" @click="toggleMenu"> <span aria-hidden="true">×</span> diff --git a/i18n/locales/dateTimeFormats.js b/i18n/locales/dateTimeFormats.js index 6ed3420..5c76b3b 100644 --- a/i18n/locales/dateTimeFormats.js +++ b/i18n/locales/dateTimeFormats.js @@ -15,6 +15,11 @@ export const dateTimeFormats = { }, min: { minute: '2-digit' + }, + time: { + hour: 'numeric', + minute: '2-digit', + hour12: false, } }, 'en': { @@ -33,6 +38,11 @@ export const dateTimeFormats = { }, min: { minute: '2-digit' + }, + time: { + hour: 'numeric', + minute: '2-digit', + hour12: true, } }, 'es': { @@ -51,6 +61,11 @@ export const dateTimeFormats = { }, min: { minute: '2-digit' + }, + time: { + hour: 'numeric', + minute: '2-digit', + hour12: false, } } } \ No newline at end of file -- GitLab