diff --git a/src/components/GanttChart/GanttChart.vue b/src/components/GanttChart/GanttChart.vue index 077ad5692e1b149862d659fb5c0bfc9b8b1ad1b8..cd5b09252776ca402a506a1335f7ee013139c5d5 100644 --- a/src/components/GanttChart/GanttChart.vue +++ b/src/components/GanttChart/GanttChart.vue @@ -220,12 +220,23 @@ function clearOriginalMaps() { function convertToLocalTime(utcString: string): string { const d = new Date(utcString) - const iso = d.toISOString() - // ๐ข เธเธทเธเนเธเธเนเธกเนเนเธเธฅเธ timezone (เนเธเนเธ•เธฑเธ”เน€เธงเธฅเธฒเนเธซเน format เธชเธงเธข) - return iso.slice(0, 16).replace('T', ' ') + + const isLocalhost = ['localhost', '127.0.0.1'].includes(window.location.hostname) + + if (isLocalhost) { + // ๐ข เนเธเธฅเธเน€เธเนเธ local time (Asia/Bangkok) + d.setHours(d.getHours() + 7) // เธเธฃเธฑเธ +7 เธเธฑเนเธงเนเธกเธ + const iso = d.toISOString() + return iso.slice(0, 16).replace('T', ' ') + } else { + // ๐”ต Prod โ’ เนเธกเนเนเธเธฅเธ timezone, เนเธเน format เธชเธงเธข เน + const iso = d.toISOString() + return iso.slice(0, 16).replace('T', ' ') + } } + // Pagination & Dialog const pages = computed(() => pageStore.pages.map((p) => p.pagenum)) const pageToShowDelete = ref<number | null>(null)