Countdown now shows time in CET
This commit is contained in:
@@ -130,7 +130,20 @@ export const ChallengeList: React.FC = () => {
|
|||||||
const isStartedManual = state.isStarted;
|
const isStartedManual = state.isStarted;
|
||||||
|
|
||||||
if (now < startTime && !currentUser?.isAdmin) {
|
if (now < startTime && !currentUser?.isAdmin) {
|
||||||
const utcStartTime = new Date(startTime).toUTCString();
|
const date = new Date(startTime);
|
||||||
|
const utcStartTime = date.toUTCString().replace('GMT', 'UTC');
|
||||||
|
const cetStartTime = new Intl.DateTimeFormat('en-GB', {
|
||||||
|
timeZone: 'CET',
|
||||||
|
weekday: 'short',
|
||||||
|
day: '2-digit',
|
||||||
|
month: 'short',
|
||||||
|
year: 'numeric',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
second: '2-digit',
|
||||||
|
hour12: false
|
||||||
|
}).format(date).replace(',', '') + ' CET';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-w-4xl mx-auto py-32 text-center hxp-border border-4 p-12">
|
<div className="max-w-4xl mx-auto py-32 text-center hxp-border border-4 p-12">
|
||||||
<Clock className="w-20 h-20 text-[#bf00ff] mx-auto mb-6 animate-pulse" />
|
<Clock className="w-20 h-20 text-[#bf00ff] mx-auto mb-6 animate-pulse" />
|
||||||
@@ -139,6 +152,7 @@ export const ChallengeList: React.FC = () => {
|
|||||||
<Countdown target={startTime} onEnd={() => setShowRefreshPopup(true)} />
|
<Countdown target={startTime} onEnd={() => setShowRefreshPopup(true)} />
|
||||||
</div>
|
</div>
|
||||||
<p className="text-slate-500 font-bold tracking-widest uppercase mt-6">Event will start {utcStartTime}</p>
|
<p className="text-slate-500 font-bold tracking-widest uppercase mt-6">Event will start {utcStartTime}</p>
|
||||||
|
<p className="text-slate-500 font-bold tracking-widest uppercase mt-2">Event will start {cetStartTime}</p>
|
||||||
{showRefreshPopup && (
|
{showRefreshPopup && (
|
||||||
<div className="fixed inset-0 bg-black/90 z-[500] flex items-center justify-center p-4">
|
<div className="fixed inset-0 bg-black/90 z-[500] flex items-center justify-center p-4">
|
||||||
<div className="hxp-border border-4 bg-black p-10 text-center max-w-sm">
|
<div className="hxp-border border-4 bg-black p-10 text-center max-w-sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user