Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/browser/components/TitleBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ function hasBuildInfo(value: unknown): value is VersionMetadata {
return typeof candidate.buildTime === "string";
}

function formatUSDate(isoDate: string): string {
function formatLocalDate(isoDate: string): string {
const date = new Date(isoDate);
const month = String(date.getUTCMonth() + 1).padStart(2, "0");
const day = String(date.getUTCDate()).padStart(2, "0");
const year = date.getUTCFullYear();
return `${month}/${day}/${year}`;
return date.toLocaleDateString(undefined, {
year: "numeric",
month: "2-digit",
day: "2-digit",
});
}

function formatExtendedTimestamp(isoDate: string): string {
Expand All @@ -61,7 +62,7 @@ function parseBuildInfo(version: unknown) {
const gitDescribe = typeof git_describe === "string" ? git_describe : undefined;

return {
buildDate: formatUSDate(buildTime),
buildDate: formatLocalDate(buildTime),
extendedTimestamp: formatExtendedTimestamp(buildTime),
gitDescribe,
};
Expand Down