API ข้อมูลตำแหน่ง
This commit is contained in:
parent
a595c1a5e9
commit
a6293efa69
5 changed files with 99 additions and 23 deletions
|
|
@ -1149,6 +1149,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,
|
||||
|
|
@ -1195,5 +1208,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
downloadRenameFileByLink,
|
||||
|
||||
onSearchDataTable,
|
||||
formatDatePosition,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue