Skip to content

Commit

Permalink
fix Date and Time
Browse files Browse the repository at this point in the history
  • Loading branch information
bosung90 committed Oct 16, 2023
1 parent 5828b17 commit f36f288
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/checkout/[eventId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
const handleClick = () => {
dialog?.showModal()
}
$: eventTime = event && DateTime.fromISO(event.date)
$: eventTimeTo = event && DateTime.fromISO(event.date).plus({seconds: event.duration})
</script>

<svelte:head>
Expand All @@ -44,11 +47,12 @@
<div class="grid grid-cols-[100px_1fr] gap-2">
<h3 class="font-semibold text-lg text-royalBlue-700 tracking-tighter">Date</h3>
<div class="pt-0.5 text-gray-600">
{event && DateTime.fromISO(event.date).toLocaleString(DateTime.DATE_FULL)}
{eventTime && eventTime.toLocaleString(DateTime.DATE_FULL)}
</div>
<h3 class="font-semibold text-lg text-royalBlue-700 tracking-tighter">Time</h3>
<div class="pt-0.5 text-gray-600">
{event && DateTime.fromISO(event.date).toLocaleString(DateTime.DATE_FULL)}
{eventTime && eventTime.toLocaleString(DateTime.TIME_SIMPLE)}
{eventTimeTo && '- ' + eventTimeTo.toLocaleString(DateTime.TIME_SIMPLE)}
</div>
<h3 class="font-semibold text-lg text-royalBlue-700">Location</h3>
<div class="pt-0.5 text-gray-600">
Expand Down

0 comments on commit f36f288

Please sign in to comment.