ระยะเวลาดำลงตำแหน่ง
This commit is contained in:
parent
0e5e7ac5be
commit
42301c4830
4 changed files with 184 additions and 76 deletions
|
|
@ -1158,6 +1158,19 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
});
|
||||
}
|
||||
|
||||
function formatDatePosition(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 {
|
||||
calAge,
|
||||
date2Thai,
|
||||
|
|
@ -1197,5 +1210,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
findOrgNameOld,
|
||||
findPosMasterNo,
|
||||
onSearchDataTable,
|
||||
formatDatePosition,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue