Fix 24-hour time format

This commit is contained in:
Eduard Kuzmenko 2021-04-16 05:00:58 +04:00
parent 1b66a3dd73
commit b596502fa9
2 changed files with 5 additions and 1 deletions

View File

@ -65,6 +65,8 @@ export function formatDateAccordingToTodayNew(time: Date) {
}).element;
}
MOUNT_CLASS_TO && (MOUNT_CLASS_TO.formatDateAccordingToTodayNew = formatDateAccordingToTodayNew);
export const getFullDate = (date: Date, options: Partial<{
noTime: true,
noSeconds: true,

View File

@ -352,7 +352,9 @@ namespace I18n {
safeAssign(this, options);
//var options = { month: 'long', day: 'numeric' };
const dateTimeFormat = new Intl.DateTimeFormat(lastRequestedLangCode, this.options);
// * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle#adding_an_hour_cycle_via_the_locale_string
const dateTimeFormat = new Intl.DateTimeFormat(lastRequestedLangCode + '-u-hc-h23', this.options);
(this.element as any)[this.property] = capitalizeFirstLetter(dateTimeFormat.format(this.date));
}