fixing
This commit is contained in:
parent
4b160bb48c
commit
e7eb440ca6
2 changed files with 24 additions and 4 deletions
|
|
@ -1163,6 +1163,20 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
// return `${y} ปี ${m} เดือน ${d} วัน`;
|
||||
}
|
||||
|
||||
function formatDatePositionReport(year: string, month: string, day: string) {
|
||||
const y = parseInt(year);
|
||||
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} วัน`);
|
||||
|
||||
return parts.length > 0 ? parts.join(" ") : ""; // กรณีที่ทั้งหมดเป็น 0
|
||||
// return `${y} ปี ${m} เดือน ${d} วัน`;
|
||||
}
|
||||
|
||||
return {
|
||||
calAge,
|
||||
date2Thai,
|
||||
|
|
@ -1210,5 +1224,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
|
||||
onSearchDataTable,
|
||||
formatDatePosition,
|
||||
formatDatePositionReport,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue