This commit is contained in:
the-djmaze 2022-12-22 19:40:11 +01:00
parent 18b7b39b49
commit e4b1950dbe
12 changed files with 119 additions and 70 deletions

View file

@ -31,7 +31,7 @@ html.rl-no-preview-pane {
.day {
background:rgba(128,128,128,0.2);
font-size: 90%;
font-size: 12px;
line-height: 2;
text-align: center;
text-transform: capitalize;

View file

@ -117,6 +117,7 @@ html.rl-no-preview-pane {
border-radius: var(--border-radius, 5px) var(--border-radius, 5px) 0 0;
padding: 10px;
flex-shrink: 0;
word-break: keep-all;
.fontastic + span {
margin-left: 0.25em;
@ -180,10 +181,6 @@ html.rl-no-preview-pane {
white-space: nowrap;
width: 1%;
}
td + td {
word-break: break-all;
}
}
.hasVirus {

View file

@ -146,21 +146,22 @@ export class MailMessageList extends AbstractViewRight {
mobileCheckedStateHide: () => ThemeStore.isMobile() ? !MessagelistUserStore.hasChecked() : 1,
// Idea for https://github.com/the-djmaze/snappymail/issues/737
listByDay: () => {
let list = [], current, today = Ymd(new Date()), lang = doc.documentElement.lang;
let list = [], current, today = Ymd(new Date()),
rtf = new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" });
MessagelistUserStore.forEach(msg => {
let date = (new Date(msg.dateTimeStampInUTC() * 1000)),
ymd = Ymd(date);
if (!current || ymd != current.ymd) {
if (today == ymd) {
date = new Intl.RelativeTimeFormat(lang, { numeric: "auto" }).format(0, 'day');
date = rtf.format(0, 'day');
} else if (today - 1 == ymd) {
date = new Intl.RelativeTimeFormat(lang, { numeric: "auto" }).format(-1, 'day');
date = rtf.format(-1, 'day');
// } else if (today - 7 < ymd) {
// date = date.format('l');
// date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
} else {
// date = date.format('LL',0,LanguageStore.hourCycle());
// date = date.format({dateStyle: 'medium'},0,LanguageStore.hourCycle());
date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
}
current = {