mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 07:19:36 +02:00
chore: Update time zone handling in code
This commit is contained in:
parent
4d193bc44d
commit
2b16712496
9 changed files with 18 additions and 15 deletions
|
@ -112,7 +112,7 @@ DATABASES = {
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
TIME_ZONE = 'America/New_York'
|
TIME_ZONE = 'UTC'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
{#if adventure.date && adventure.date !== ''}
|
{#if adventure.date && adventure.date !== ''}
|
||||||
<div class="inline-flex items-center">
|
<div class="inline-flex items-center">
|
||||||
<Calendar class="w-5 h-5 mr-1" />
|
<Calendar class="w-5 h-5 mr-1" />
|
||||||
<p>{new Date(adventure.date).toLocaleDateString('en-US', { timeZone: 'UTC' })}</p>
|
<p>{new Date(adventure.date).toLocaleDateString(undefined, { timeZone: 'UTC' })}</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if adventure.activity_types && adventure.activity_types.length > 0}
|
{#if adventure.activity_types && adventure.activity_types.length > 0}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
{#if checklist.date && checklist.date !== ''}
|
{#if checklist.date && checklist.date !== ''}
|
||||||
<div class="inline-flex items-center">
|
<div class="inline-flex items-center">
|
||||||
<Calendar class="w-5 h-5 mr-1" />
|
<Calendar class="w-5 h-5 mr-1" />
|
||||||
<p>{new Date(checklist.date).toLocaleDateString('en-US', { timeZone: 'UTC' })}</p>
|
<p>{new Date(checklist.date).toLocaleDateString(undefined, { timeZone: 'UTC' })}</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="card-actions justify-end">
|
<div class="card-actions justify-end">
|
||||||
|
|
|
@ -98,9 +98,8 @@
|
||||||
<p>{collection.adventures.length} Adventures</p>
|
<p>{collection.adventures.length} Adventures</p>
|
||||||
{#if collection.start_date && collection.end_date}
|
{#if collection.start_date && collection.end_date}
|
||||||
<p>
|
<p>
|
||||||
Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date(
|
Dates: {new Date(collection.start_date).toLocaleDateString(undefined, { timeZone: 'UTC' })} -
|
||||||
collection.end_date
|
{new Date(collection.end_date).toLocaleDateString(undefined, { timeZone: 'UTC' })}
|
||||||
).toLocaleDateString('en-US', { timeZone: 'UTC' })}
|
|
||||||
</p>
|
</p>
|
||||||
<!-- display the duration in days -->
|
<!-- display the duration in days -->
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
{#if note.date && note.date !== ''}
|
{#if note.date && note.date !== ''}
|
||||||
<div class="inline-flex items-center">
|
<div class="inline-flex items-center">
|
||||||
<Calendar class="w-5 h-5 mr-1" />
|
<Calendar class="w-5 h-5 mr-1" />
|
||||||
<p>{new Date(note.date).toLocaleDateString('en-US', { timeZone: 'UTC' })}</p>
|
<p>{new Date(note.date).toLocaleDateString(undefined, { timeZone: 'UTC' })}</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="card-actions justify-end">
|
<div class="card-actions justify-end">
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
{#if transportation.date}
|
{#if transportation.date}
|
||||||
{new Date(transportation.date).toLocaleString()}
|
{new Date(transportation.date).toLocaleString(undefined, { timeZone: 'UTC' })}
|
||||||
{/if}
|
{/if}
|
||||||
{#if user?.pk === transportation.user_id}
|
{#if user?.pk === transportation.user_id}
|
||||||
<div class="card-actions justify-end">
|
<div class="card-actions justify-end">
|
||||||
|
|
|
@ -169,7 +169,9 @@
|
||||||
<path d="M3 10h18"></path>
|
<path d="M3 10h18"></path>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="text-sm text-muted-foreground"
|
<span class="text-sm text-muted-foreground"
|
||||||
>{new Date(adventure.date).toLocaleDateString()}</span
|
>{new Date(adventure.date).toLocaleDateString(undefined, {
|
||||||
|
timeZone: 'UTC'
|
||||||
|
})}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -309,7 +311,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{adventure.date
|
{adventure.date
|
||||||
? new Date(adventure.date).toLocaleDateString('en-US', {
|
? new Date(adventure.date).toLocaleDateString(undefined, {
|
||||||
timeZone: 'UTC'
|
timeZone: 'UTC'
|
||||||
})
|
})
|
||||||
: ''}
|
: ''}
|
||||||
|
|
|
@ -510,9 +510,9 @@
|
||||||
<p class="text-center text-lg pl-16 pr-16">Duration: {numberOfDays} days</p>
|
<p class="text-center text-lg pl-16 pr-16">Duration: {numberOfDays} days</p>
|
||||||
{/if}
|
{/if}
|
||||||
<p class="text-center text-lg pl-16 pr-16">
|
<p class="text-center text-lg pl-16 pr-16">
|
||||||
Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date(
|
Dates: {new Date(collection.start_date).toLocaleDateString(undefined, { timeZone: 'UTC' })} - {new Date(
|
||||||
collection.end_date
|
collection.end_date
|
||||||
).toLocaleDateString('en-US', { timeZone: 'UTC' })}
|
).toLocaleDateString(undefined, { timeZone: 'UTC' })}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{#each Array(numberOfDays) as _, i}
|
{#each Array(numberOfDays) as _, i}
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
)[dateString]}
|
)[dateString]}
|
||||||
|
|
||||||
<h2 class="text-center font-semibold text-2xl mb-2 mt-4">
|
<h2 class="text-center font-semibold text-2xl mb-2 mt-4">
|
||||||
Day {i + 1} - {currentDate.toLocaleDateString('en-US', { timeZone: 'UTC' })}
|
Day {i + 1} - {currentDate.toLocaleDateString(undefined, { timeZone: 'UTC' })}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||||
{#if dayAdventures.length > 0}
|
{#if dayAdventures.length > 0}
|
||||||
|
@ -626,7 +626,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{adventure.date
|
{adventure.date
|
||||||
? new Date(adventure.date).toLocaleDateString('en-US', { timeZone: 'UTC' })
|
? new Date(adventure.date).toLocaleDateString(undefined, { timeZone: 'UTC' })
|
||||||
: ''}
|
: ''}
|
||||||
</p>
|
</p>
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|
|
@ -50,7 +50,9 @@
|
||||||
<p class="ml-1 text-lg text-center mt-4">Member Since</p>
|
<p class="ml-1 text-lg text-center mt-4">Member Since</p>
|
||||||
<div class="flex items-center justify-center text-center">
|
<div class="flex items-center justify-center text-center">
|
||||||
<iconify-icon icon="mdi:calendar" class="text-2xl"></iconify-icon>
|
<iconify-icon icon="mdi:calendar" class="text-2xl"></iconify-icon>
|
||||||
<p class="ml-1 text-xl">{new Date(data.user.date_joined).toLocaleDateString()}</p>
|
<p class="ml-1 text-xl">
|
||||||
|
{new Date(data.user.date_joined).toLocaleDateString(undefined, { timeZone: 'UTC' })}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue