diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 48ca0e791..16df8875c 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -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, }; });