Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Change commit dates to formatTimestamp fn
Sebastian Martinez committed 3 years ago
commit e6faced6f62cc07e66a4b8f35961a62bbd7d5022
parent aa62ef0bc11c72149508b6a866a650f54c0d9d67
2 files changed +2 -10
modified src/base/projects/Commit/CommitAuthorship.svelte
@@ -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>
modified src/commit.ts
@@ -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;