@@ -5,9 +5,11 @@ import { useState, useEffect } from "react"
55import { TicketPeriod } from "./ticket-period"
66
77// Ticket period end dates (using zero-indexed months)
8- const EARLY_BIRD_END_DATE = new Date ( 2025 , 6 , 13 , 23 , 59 ) // July 13th
9- const STANDARD_END_DATE = new Date ( 2025 , 7 , 31 , 23 , 59 ) // August 31st
10- const LATE_END_DATE = new Date ( 2025 , 8 , 10 , 23 , 59 ) // September 10th
8+ // Dates are specified in CET (UTC+1/UTC+2 for CEST) and converted to UTC
9+ // Example: July 13th 23:59 CEST (UTC+2) becomes July 13th 21:59 UTC
10+ const EARLY_BIRD_END_DATE = new Date ( Date . UTC ( 2025 , 6 , 13 , 21 , 59 ) ) // July 13th 23:59 CEST
11+ const STANDARD_END_DATE = new Date ( Date . UTC ( 2025 , 7 , 31 , 21 , 59 ) ) // August 31st 23:59 CEST
12+ const LATE_END_DATE = new Date ( Date . UTC ( 2025 , 8 , 10 , 21 , 59 ) ) // September 10th 23:59 CEST
1113
1214export function TicketPeriods ( ) {
1315 const now = useCurrentDate ( )
@@ -19,34 +21,34 @@ export function TicketPeriods() {
1921 price = "$599"
2022 date = { EARLY_BIRD_END_DATE }
2123 comingSoon = { false }
22- soldOut = { now > EARLY_BIRD_END_DATE }
24+ isLoading = { ! now }
25+ soldOut = { ! ! now && now > EARLY_BIRD_END_DATE }
2326 />
2427 < TicketPeriod
2528 name = "Standard"
2629 price = "$799"
2730 date = { [ new Date ( 2025 , 6 , 14 ) , STANDARD_END_DATE ] }
28- comingSoon = { now < EARLY_BIRD_END_DATE }
29- soldOut = { now > STANDARD_END_DATE }
31+ isLoading = { ! now }
32+ comingSoon = { ! ! now && now < EARLY_BIRD_END_DATE }
33+ soldOut = { ! ! now && now > STANDARD_END_DATE }
3034 />
3135 < TicketPeriod
3236 name = "Late"
3337 price = "$899"
3438 date = { [ new Date ( 2025 , 8 , 1 ) , LATE_END_DATE ] }
35- comingSoon = { now < STANDARD_END_DATE }
36- soldOut = { now > LATE_END_DATE }
39+ isLoading = { ! now }
40+ comingSoon = { ! ! now && now < STANDARD_END_DATE }
41+ soldOut = { ! ! now && now > LATE_END_DATE }
3742 />
3843 </ >
3944 )
4045}
4146
42- const DEFAULT_DATE = new Date ( 2025 , 8 , 12 )
43-
4447function useCurrentDate ( ) {
45- const [ date , setDate ] = useState < Date > ( DEFAULT_DATE )
48+ const [ date , setDate ] = useState < Date | null > ( null )
4649
4750 useEffect ( ( ) => {
48- const end = new Date ( 2025 , 6 , 14 )
49- setDate ( end )
51+ setDate ( new Date ( ) )
5052 } , [ ] )
5153
5254 return date
0 commit comments