ปรับ ui form
This commit is contained in:
parent
8ea5ad36da
commit
68ef892d62
8 changed files with 230 additions and 246 deletions
|
|
@ -68,8 +68,21 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
dstTime
|
||||
);
|
||||
}
|
||||
function covertDateObject(date: string) {
|
||||
if (date) {
|
||||
const dateParts = date.split("/");
|
||||
// ประกาศตัวแปรเพื่อเก็บค่าวันที่, เดือน, และ ปี
|
||||
const day = parseInt(dateParts[0], 10);
|
||||
const month = parseInt(dateParts[1], 10) - 1;
|
||||
const year = parseInt(dateParts[2], 10) + 2500;
|
||||
// สร้างอ็อบเจ็กต์ Date ด้วยค่าที่ได้
|
||||
const dateObject = new Date(year, month, day);
|
||||
return date2Thai(dateObject);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
date2Thai,
|
||||
covertDateObject,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue