Align displayed time for 24 hours format (#11703)

This commit is contained in:
Azri Kahar
2022-02-18 23:22:12 +08:00
committed by GitHub
parent abb2ecdf2e
commit 240a2b09f7
2 changed files with 4 additions and 1 deletions

View File

@@ -70,7 +70,8 @@ export default defineComponent({
displayValue.value = null;
return;
}
const timeFormat = props.includeSeconds ? 'date-fns_time' : 'date-fns_time_no_seconds';
let timeFormat = props.includeSeconds ? 'date-fns_time' : 'date-fns_time_no_seconds';
if (props.use24) timeFormat = props.includeSeconds ? 'date-fns_time_24hour' : 'date-fns_time_no_seconds_24hour';
let format = `${t('date-fns_date')} ${t(timeFormat)}`;
if (props.type === 'date') format = String(t('date-fns_date'));
if (props.type === 'time') format = String(t(timeFormat));

View File

@@ -363,6 +363,8 @@ delete_share: Delete Share
date-fns_date: PPP
date-fns_time: 'h:mm:ss a'
date-fns_time_no_seconds: 'h:mm a'
date-fns_time_24hour: 'HH:mm:ss'
date-fns_time_no_seconds_24hour: 'HH:mm'
date-fns_date_short: 'MMM d, u'
date-fns_time_short: 'h:mma'
date-fns_date_short_no_year: MMM d