From b88fc3c5d1f417666e45dc3797e579b9048a2ac9 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 27 Oct 2023 09:46:04 -0700 Subject: [PATCH] feat: makes hour time format always 2 digits (#2452) --- assets/auto-imports.d.ts | 2 +- assets/components/common/DateTime.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index cf52783b..362e22d2 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -362,7 +362,7 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' } // for vue template auto import import { UnwrapRef } from 'vue' diff --git a/assets/components/common/DateTime.vue b/assets/components/common/DateTime.vue index ca43bdd1..d82013b2 100644 --- a/assets/components/common/DateTime.vue +++ b/assets/components/common/DateTime.vue @@ -14,7 +14,7 @@ const dateFormatter = new Intl.DateTimeFormat(undefined, { day: "2-digit", month const use12Hour = $computed(() => ({ auto: undefined, "12": true, "24": false })[hourStyle.value]); const timeFormatter = $computed( () => - new Intl.DateTimeFormat(undefined, { hour: "numeric", minute: "2-digit", second: "2-digit", hour12: use12Hour }), + new Intl.DateTimeFormat(undefined, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: use12Hour }), ); const dateStr = $computed(() => dateFormatter.format(props.date));