mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-01 01:30:46 +08:00
Change commit dates to formatTimestamp fn
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
@@ -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> at </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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user