This commit is contained in:
the-djmaze 2023-01-17 14:26:00 +01:00
parent d41f9d8eee
commit 98996ba4b7
3 changed files with 6 additions and 4 deletions

View file

@ -107,7 +107,7 @@ export const
switch (formatStr) {
case 'FROMNOW':
return fromNow(m);
case 'SHORT': {
case 'AUTO': {
// 4 hours
if (14400000 >= now - time)
return fromNow(m);
@ -119,7 +119,9 @@ export const
{TIME: m.format('LT',0,h)}
)
: m.format(
date.getFullYear() === m.getFullYear() ? {day: '2-digit', month: 'short'} : {dateStyle: 'medium'}
date.getFullYear() === m.getFullYear()
? {day: '2-digit', month: 'short', hour: 'numeric', minute: 'numeric'}
: {dateStyle: 'medium', timeStyle: 'short'}
, 0, h);
}
case 'FULL':