diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 26893035..7cf0f750 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -17,5 +17,6 @@ jobs: - run: LANG=en_CA TZ=America/Vancouver yarn test - run: LANG=en_US TZ=America/Los_Angeles yarn test - run: LANG=sw_KE TZ=Africa/Nairobi yarn test + - run: LANG=en_KI TZ=Pacific/Kiritimati yarn test - run: LANG=jp_JP TZ=Asia/Tokyo yarn test-ci - run: nyc report --reporter=json && codecov -t ${{ secrets.CODECOV_REPO_TOKEN }} -f coverage/*.json diff --git a/src/dateutil.ts b/src/dateutil.ts index 66b43a61..b2cd176a 100644 --- a/src/dateutil.ts +++ b/src/dateutil.ts @@ -86,10 +86,12 @@ export const tzOffset = function (date: Date) { export const daysBetween = function (date1: Date, date2: Date) { // The number of milliseconds in one day // Convert both dates to milliseconds - const date1ms = date1.getTime() - tzOffset(date1) - const date2ms = date2.getTime() - tzOffset(date2) + const date1ms = date1.getTime() + const date2ms = date2.getTime() + // Calculate the difference in milliseconds const differencems = date1ms - date2ms + // Convert back to days and return return Math.round(differencems / ONE_DAY) }