Browse Source

abbreviated date

master
Gisle Aune 2 years ago
parent
commit
8cf56a4349
  1. 6
      frontend/src/lib/utils/date.ts

6
frontend/src/lib/utils/date.ts

@ -142,12 +142,10 @@ export function formatDays(date: Date, now: Date) {
if (diff === 0) {
return "today";
} else if (diff === 1) {
return "tomorrow";
} else if (diff < 7) {
return `${diff} days`;
return `${diff}d`;
} else {
return `${Math.floor(diff / 7)} weeks`;
return `${Math.floor(diff / 7)}w${Math.floor(diff % 7)}d`;
}
}

Loading…
Cancel
Save