เพิ่มฟังก์ชั่นคำนวน diff days ใน mixin
This commit is contained in:
parent
492577c34c
commit
f0455d45cf
1 changed files with 8 additions and 0 deletions
|
|
@ -915,6 +915,13 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
return "";
|
||||
}
|
||||
|
||||
function diffDay(startDate: any, endDate: any) {
|
||||
var d1 = moment(startDate);
|
||||
var d2 = moment(endDate);
|
||||
const daydiff = Math.ceil(moment.duration(d2.diff(d1)).asDays());
|
||||
return daydiff;
|
||||
}
|
||||
|
||||
return {
|
||||
calAge,
|
||||
date2Thai,
|
||||
|
|
@ -951,5 +958,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
fails,
|
||||
convertDate,
|
||||
convertDateDisplay,
|
||||
diffDay,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue