Cleanup locate time handling

This commit is contained in:
the-djmaze 2022-12-23 12:22:57 +01:00
parent fca7e44aa0
commit b0ed74575f
9 changed files with 58 additions and 71 deletions

View file

@ -696,7 +696,7 @@ export class ComposePopupView extends AbstractViewPopup {
.replace(/\r/g, '')
.replace(/\s{1,2}?{{FROM}}/g, '')
.replace(/\s{1,2}?{{FROM-FULL}}/g, '')
.replace(/{{DATE}}/g, new Date().format('LLLL'))
.replace(/{{DATE}}/g, new Date().format({dateStyle: 'full', timeStyle: 'short'}))
.replace(/{{TIME}}/g, new Date().format('LT'))
.replace(/{{MOMENT:[^}]+}}/g, '');
signature.length && editor.setSignature(signature, isHtml, !!identity.signatureInsertBefore());

View file

@ -69,7 +69,7 @@ export class LoginUserView extends AbstractViewLogin {
language: value => {
this.langRequest(true);
translatorReload(false, value).then(
translatorReload(value).then(
() => {
this.langRequest(false);
this.bSendLanguage = true;

View file

@ -149,17 +149,18 @@ export class MailMessageList extends AbstractViewRight {
listByDay: () => {
let list = [], current, today = Ymd(new Date()),
rtf = new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" });
rtf = Intl.RelativeTimeFormat
? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0;
MessagelistUserStore.forEach(msg => {
let date = (new Date(msg.dateTimeStampInUTC() * 1000)),
ymd = Ymd(date);
if (!current || ymd != current.ymd) {
if (today == ymd) {
if (rtf && today == ymd) {
date = rtf.format(0, 'day');
} else if (today - 1 == ymd) {
} else if (rtf && today - 1 == ymd) {
date = rtf.format(-1, 'day');
// } else if (today - 7 < ymd) {
// date = date.format('l');
// date = date.format({weekday: 'long'});
// date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
} else {
// date = date.format({dateStyle: 'medium'},0,LanguageStore.hourCycle());