web: added interval minute, profile list and profile view

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-11-01 20:36:19 +01:00
parent 5a4765526b
commit 09672b34a3
19 changed files with 394 additions and 136 deletions

View File

@@ -2,7 +2,7 @@ import { type IInterval } from "@/types";
export function formatDateInterval(interval: IInterval, date: Date): string {
if (interval === "hour") {
if (interval === "hour" || interval === "minute") {
return new Intl.DateTimeFormat("en-GB", {
hour: "2-digit",
minute: "2-digit",
@@ -14,11 +14,11 @@ export function formatDateInterval(interval: IInterval, date: Date): string {
}
if (interval === "day") {
return new Intl.DateTimeFormat("en-GB", { weekday: "short" }).format(
return new Intl.DateTimeFormat("en-GB", { weekday: "short", day: '2-digit', month: '2-digit' }).format(
date,
);
}
return date.toISOString();
}