Skip to content

Commit 907effe

Browse files
committed
refactor(commit): refactor git commands, use Intl for formatting
1 parent 8d8898e commit 907effe

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/modals/about-modal.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ import { useDialog } from "@/composable/useDialog";
7474
7575
const dialogRef = useTemplateRef("dialogElement");
7676
const { open, close } = useDialog(dialogRef);
77-
const commitDate = dayjs(import.meta.env.VITE_GIT_COMMIT_DATE).format("DD.MM.YY");
77+
const commitDate = new Intl.DateTimeFormat(
78+
navigator.language,
79+
{ year: "numeric", month: "long", day: "numeric" }
80+
).format(dayjs(import.meta.env.VITE_GIT_COMMIT_DATE).toDate());
7881
</script>
7982
<style lang="scss">
8083
.about {

vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { execSync } from "node:child_process";
1+
import { execFileSync } from "node:child_process";
22
import process from "node:process";
33
import { fileURLToPath, URL } from "node:url";
44
import Vue from "@vitejs/plugin-vue";
@@ -9,7 +9,7 @@ import VueRouter from "vue-router/vite";
99
import type { TreeNode } from "vue-router/unplugin";
1010
import PWA_OPTIONS from "./src/constants/pwa-options.ts";
1111

12-
const commitDate = execSync("git log -1 --format=%cI").toString().trimEnd();
12+
const commitDate = execFileSync("git", ["log", "-1", "--no-merges", "--format=%cI"], { encoding: "utf8" }).trim();
1313

1414
function getRouteName(node: TreeNode): string {
1515
if (!node.parent) return "";

0 commit comments

Comments
 (0)