Skip to content

Commit

Permalink
Show time in local tz instead of UTC (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kexort authored Nov 7, 2024
1 parent a0862c7 commit 84cabe2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ export function shortenTitle(title?: string, maxTitleLength?: number): string {

// From "2022-10-11T15:30:00.000Z" to "15:30"
export function dateToTime(date?: string): string {
return !date ? "" : date.substring(11, 16);
if (!date) {
return "";
}
return new Date(date).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
hour12: false,
});
}

export function getSessionsByDay(
Expand Down

0 comments on commit 84cabe2

Please sign in to comment.