From f0455d45cf0aac72815aff2a150f4ce2f75e1783 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 4 Apr 2024 17:33:29 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=9F=E0=B8=B1=E0=B8=87=E0=B8=81=E0=B9=8C=E0=B8=8A=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=99=E0=B8=84=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99?= =?UTF-8?q?=20diff=20days=20=E0=B9=83=E0=B8=99=20mixin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/mixin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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, }; });