Skip to content

Commit b0981c1

Browse files
committed
Timezone fix for JS
1 parent bdf18a0 commit b0981c1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@vueuse/core": "^13.0.0",
1919
"@vueuse/integrations": "^13.2.0",
2020
"date-fns": "^4.1.0",
21+
"date-fns-tz": "^3.2.0",
2122
"globals": "^16.0.0",
2223
"laravel-vite-plugin": "^1.2.0",
2324
"lodash-es": "^4.17.21",

resources/js/pages/admin/users/Index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import { ref, useTemplateRef } from 'vue';
33
import { FilterMatchMode } from '@primevue/core/api';
44
import { AlertCircle, EllipsisVertical, FunnelX, Pencil } from 'lucide-vue-next';
5-
import { format, parseISO } from 'date-fns';
5+
import { formatInTimeZone } from 'date-fns-tz';
6+
import { parseISO } from 'date-fns';
67
import { useLazyDataTable } from '@/composables/useLazyDataTable';
78
import AppLayout from '@/layouts/AppLayout.vue';
89
import ClientOnly from '@/components/ClientOnly.vue';
@@ -179,7 +180,7 @@ const {
179180
/>
180181
</template>
181182
<template #body="{ data }">
182-
{{ format(parseISO(data.created_at), 'MM/dd/yyyy') }}
183+
{{ formatInTimeZone(parseISO(data.created_at), 'UTC', 'MM/dd/yyyy') }}
183184
</template>
184185
</Column>
185186
<Column header="Action">

0 commit comments

Comments
 (0)