fix formatDatePosition

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-02-28 16:58:03 +07:00
parent e8c830454a
commit 6ae4dcd7bf

View file

@ -1155,9 +1155,9 @@ export const useCounterMixin = defineStore("mixin", () => {
const d = parseInt(day);
const parts = [];
if (y > 0) parts.push(`${y}ปี`);
if (m > 0) parts.push(`${m}เดือน`);
if (d > 0) parts.push(`${d}วัน`);
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
}