Fix timezone issue: dates now display correctly by forcing local time interpretation
This commit is contained in:
@@ -34,7 +34,8 @@ defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
function formatDate(dateString: string) {
|
function formatDate(dateString: string) {
|
||||||
const date = new Date(dateString)
|
// Add T00:00:00 to ensure the date is interpreted as local time, not UTC
|
||||||
|
const date = new Date(dateString + 'T00:00:00')
|
||||||
return date.toLocaleDateString('en-US', {
|
return date.toLocaleDateString('en-US', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
|
|||||||
@@ -155,7 +155,8 @@ const hasCurrentSermons = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function formatDate(dateString: string) {
|
function formatDate(dateString: string) {
|
||||||
const date = new Date(dateString)
|
// Add T00:00:00 to ensure the date is interpreted as local time, not UTC
|
||||||
|
const date = new Date(dateString + 'T00:00:00')
|
||||||
return date.toLocaleDateString('en-US', {
|
return date.toLocaleDateString('en-US', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
|
|||||||
Reference in New Issue
Block a user