Change commit dates to formatTimestamp fn

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2022-06-08 23:34:31 +02:00
parent aa62ef0bc1
commit e6faced6f6
2 changed files with 2 additions and 10 deletions
@@ -1,7 +1,6 @@
<script lang="ts">
import type { CommitMetadata } from "@app/commit";
import { gravatarURL } from "@app/utils";
import { formatCommitTime } from "@app/commit";
import { formatTimestamp, gravatarURL } from "@app/utils";
export let commit: CommitMetadata;
</script>
@@ -63,5 +62,5 @@
{/if}
{/if}
<span>&nbsp;at&nbsp;</span>
<span class="desktop-inline text-xsmall time">{formatCommitTime(commit.header.committerTime)}</span>
<span class="desktop-inline text-xsmall time">{formatTimestamp(commit.header.committerTime)}</span>
</span>
-7
View File
@@ -129,13 +129,6 @@ export function groupCommits(commits: { header: CommitHeader; context: CommitCon
}
}
export const formatCommitTime = (t: number): string => {
const options: any = {
hour: "2-digit", minute: "2-digit", timeZoneName: "short", hour12: false
};
return new Date(t * 1000).toLocaleTimeString("en-us", options);
};
export function groupCommitsByWeek(commits: CommitMetadata[]): CommitGroup[] {
const groupedCommits: CommitGroup[] = [];
let groupDate: Date | undefined = undefined;