fix formatDatePosition
This commit is contained in:
parent
cd78d15cd6
commit
a67c3c1a37
1 changed files with 6 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue