From a67c3c1a37b5d1b68c380bc49d165cf3a226abc0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 5 Mar 2025 17:39:58 +0700 Subject: [PATCH] fix formatDatePosition --- src/stores/mixin.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index fd4adacb9..40ea4b8d1 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -1154,12 +1154,13 @@ export const useCounterMixin = defineStore("mixin", () => { const m = parseInt(month); const d = parseInt(day); - const parts = []; - if (y > 0) parts.push(`${y} ปี`); - if (m > 0) parts.push(`${m} เดือน`); - if (d > 0) parts.push(`${d} วัน`); + // const parts = []; + // if (y > 0) parts.push(`${y} ปี`); + // if (m > 0) parts.push(`${m} เดือน`); + // if (d > 0) parts.push(`${d} วัน`); - return parts.length > 0 ? parts.join(" ") : ""; // กรณีที่ทั้งหมดเป็น 0 + // return parts.length > 0 ? parts.join(" ") : ""; // กรณีที่ทั้งหมดเป็น 0 + return `${y} ปี ${m} เดือน ${d} วัน`; } return {