Compare commits
5 Commits
7f0e12d1cc
...
main
Author | SHA1 | Date | |
---|---|---|---|
7d2a9e009d
|
|||
7c185fcb28
|
|||
e93a6b309d
|
|||
8dccdab641
|
|||
b28f2e150f
|
@@ -5,8 +5,11 @@ import ProgramCard from './ProgramCard.astro';
|
|||||||
const { lang = 'no', data } = Astro.props as { lang?: Lang, data: any };
|
const { lang = 'no', data } = Astro.props as { lang?: Lang, data: any };
|
||||||
const t = translations[lang];
|
const t = translations[lang];
|
||||||
|
|
||||||
const today = new Date();
|
const now = new Date();
|
||||||
today.setHours(0, 0, 0, 0);
|
const osloNow = new Date(
|
||||||
|
now.toLocaleString("en-US", { timeZone: "Europe/Oslo" })
|
||||||
|
);
|
||||||
|
osloNow.setHours(0, 0, 0, 0);
|
||||||
---
|
---
|
||||||
|
|
||||||
{data ? (
|
{data ? (
|
||||||
@@ -14,19 +17,33 @@ today.setHours(0, 0, 0, 0);
|
|||||||
<h1 class="font-bold text-3xl text-center w-full">{t.nav.program}</h1>
|
<h1 class="font-bold text-3xl text-center w-full">{t.nav.program}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-12 flex-wrap justify-center items-stretch">
|
<div class="flex gap-12 flex-wrap justify-center items-stretch">
|
||||||
{Object.entries(data).map(([date, items], idx) => (
|
{Object.entries(data).map(([date, items], idx) => {
|
||||||
<ProgramCard
|
const dateInOslo = new Date(
|
||||||
date={date}
|
new Date(date).toLocaleString("en-US", { timeZone: "Europe/Oslo" })
|
||||||
items={items}
|
);
|
||||||
lang={lang}
|
dateInOslo.setHours(0, 0, 0, 0);
|
||||||
even={idx % 2 === 1}
|
|
||||||
isPast={new Date(date) < today}
|
return (
|
||||||
/>
|
<ProgramCard
|
||||||
))}
|
date={date}
|
||||||
|
items={items}
|
||||||
|
lang={lang}
|
||||||
|
even={idx % 2 === 1}
|
||||||
|
isPast={dateInOslo < osloNow}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<p class="font-bold text-xl text-center w-full">
|
<p class="font-bold text-xl text-center w-full">
|
||||||
<a href="https://neuf.no/arrangementer" class="text-gyllen-oransje hover:text-slottsblaa hover:underline" target="_blank" rel="noopener noreferrer">{t.program.programMore}</a>
|
<a
|
||||||
|
href="https://neuf.no/arrangementer"
|
||||||
|
class="text-gyllen-oransje hover:text-slottsblaa hover:underline"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
{t.program.programMore}
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
@@ -1,22 +1,34 @@
|
|||||||
---
|
---
|
||||||
import ProgramCard from './ProgramCard.astro';
|
export const prerender = false;
|
||||||
import programData from '@data/program.json';
|
|
||||||
import { translations, type Lang } from '@data/i18n';
|
|
||||||
|
|
||||||
const { lang = 'no' } = Astro.props as { lang?: Lang };
|
import ProgramCard from "./ProgramCard.astro";
|
||||||
|
import programData from "@data/program.json";
|
||||||
|
import { translations, type Lang } from "@data/i18n";
|
||||||
|
|
||||||
|
const { lang = "no" } = Astro.props as { lang?: Lang };
|
||||||
const t = translations[lang].program;
|
const t = translations[lang].program;
|
||||||
|
|
||||||
const typedProgramData = programData as Record<string, any>;
|
const typedProgramData = programData as Record<string, any>;
|
||||||
|
|
||||||
const todayStr = new Date().toISOString().slice(0, 10);
|
const todayStr = new Intl.DateTimeFormat("en-CA", {
|
||||||
|
timeZone: "Europe/Oslo",
|
||||||
|
year: "numeric",
|
||||||
|
month: "2-digit",
|
||||||
|
day: "2-digit",
|
||||||
|
})
|
||||||
|
.format(new Date())
|
||||||
|
.replace(/(\d{4})-(\d{2})-(\d{2})/, "$1-$2-$3");
|
||||||
|
|
||||||
const items = typedProgramData[todayStr];
|
const items = typedProgramData[todayStr];
|
||||||
---
|
---
|
||||||
|
|
||||||
<section class="flex flex-col gap-6 max-w-prose">
|
<section class="flex flex-col gap-6 max-w-prose">
|
||||||
<h2 class="font-bold text-2xl">{t.today}</h2>
|
<h2 class="font-bold text-2xl">{t.today}</h2>
|
||||||
{items ? (
|
{
|
||||||
<ProgramCard date={todayStr} items={items} lang={lang} />
|
items ? (
|
||||||
) : (
|
<ProgramCard date={todayStr} items={items} lang={lang} />
|
||||||
<p>{t.noProgram}</p>
|
) : (
|
||||||
)}
|
<p>{t.noProgram}</p>
|
||||||
</section>
|
)
|
||||||
|
}
|
||||||
|
</section>
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
{ "time": "22:00", "event": "Silent Disco", "cost": "free" }
|
{ "time": "22:00", "event": "Silent Disco", "cost": "free" }
|
||||||
],
|
],
|
||||||
"2025-08-15": [
|
"2025-08-15": [
|
||||||
|
{ "time": "20:00", "event": "Toga party", "price": "free" },
|
||||||
{ "time": "21:00", "event": "Sing-a-long karaoke", "cost": "free" },
|
{ "time": "21:00", "event": "Sing-a-long karaoke", "cost": "free" },
|
||||||
{ "time": "22:00", "event": "Afterparty", "cost": "free" },
|
{ "time": "22:00", "event": "Afterparty", "cost": "free" },
|
||||||
{ "time": "22:00", "event": "Silent Disco", "cost": "free" }
|
{ "time": "22:00", "event": "Silent Disco", "cost": "free" }
|
||||||
|
@@ -15,14 +15,14 @@ export const translations = {
|
|||||||
faq: {
|
faq: {
|
||||||
title: "Ofte stilte spørsmål",
|
title: "Ofte stilte spørsmål",
|
||||||
q1: "Hvor arrangeres festivalen?",
|
q1: "Hvor arrangeres festivalen?",
|
||||||
a1: 'På <a href="https://neuf.no/praktisk#adkomst">Chateau Neuf</a>, Majorstuen, Oslo',
|
a1: 'På <a href="https://neuf.no/praktisk#adkomst">Chateau Neuf</a>, Majorstuen i Oslo',
|
||||||
q2: "Hvem er festivalen for?",
|
q2: "Hvem er festivalen for?",
|
||||||
a2: "Alle nye og gamle studenter, men arrangementene er åpne for alle som ønsker å delta.",
|
a2: "Alle nye og gamle studenter, men arrangementene er åpne for alle som ønsker å delta.",
|
||||||
q3: "Koster det penger å delta?",
|
q3: "Koster det penger å delta?",
|
||||||
a3: "Gratis inngang hver dag og nesten alle arrangementene er gratis. Kun 2 arrangementer krever kjøp av billett.",
|
a3: "Det er gratis inngang hver dag og nesten alle arrangementene er gratis. Kun 2 arrangementer krever kjøp av billett. Se programmet for mer informasjon.",
|
||||||
q4: "Må jeg har med student ID for å komme inn?",
|
q4: "Må jeg har med student-ID for å komme inn?",
|
||||||
a4: "Nei, men generell legitimasjon er påkrevd.",
|
a4: "Nei, men generell legitimasjon er påkrevd.",
|
||||||
q5: "Hva er alder årsgrensen på festivalen?",
|
q5: "Hva er aldersgrensen på festivalen?",
|
||||||
a5: "Alt er ID18+",
|
a5: "Alt er ID18+",
|
||||||
},
|
},
|
||||||
about: {
|
about: {
|
||||||
@@ -36,7 +36,7 @@ export const translations = {
|
|||||||
},
|
},
|
||||||
program: {
|
program: {
|
||||||
today: "Hva skjer i dag?",
|
today: "Hva skjer i dag?",
|
||||||
programMore: "For arrangementer etter STUDiO trykk her",
|
programMore: "For arrangementer etter STUDiO, trykk her",
|
||||||
noProgram: "Ingenting på programmet i dag :(",
|
noProgram: "Ingenting på programmet i dag :(",
|
||||||
},
|
},
|
||||||
vors: {
|
vors: {
|
||||||
@@ -69,7 +69,7 @@ export const translations = {
|
|||||||
q2: "Who is the festival for?",
|
q2: "Who is the festival for?",
|
||||||
a2: "All new and returning students, but the events are open to everyone who wants to join.",
|
a2: "All new and returning students, but the events are open to everyone who wants to join.",
|
||||||
q3: "Does it cost money?",
|
q3: "Does it cost money?",
|
||||||
a3: "Free entry every day and almost all events are free. Only 2 events require a ticket.",
|
a3: "Free entry every day and almost all events are free. Only 2 events require a ticket. See the event schedule for more information.",
|
||||||
q4: "Do I need a student ID to enter?",
|
q4: "Do I need a student ID to enter?",
|
||||||
a4: "No, but general identification is required.",
|
a4: "No, but general identification is required.",
|
||||||
q5: "What is the age limit for the festival?",
|
q5: "What is the age limit for the festival?",
|
||||||
@@ -86,7 +86,7 @@ export const translations = {
|
|||||||
},
|
},
|
||||||
program: {
|
program: {
|
||||||
today: "What's happening today?",
|
today: "What's happening today?",
|
||||||
programMore: "For events after STUDiO click here",
|
programMore: "For events after STUDiO, click here",
|
||||||
noProgram: "No events today :(",
|
noProgram: "No events today :(",
|
||||||
},
|
},
|
||||||
vors: {
|
vors: {
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
{ "time": "22:00", "event": "Silent Disco", "price": "gratis" }
|
{ "time": "22:00", "event": "Silent Disco", "price": "gratis" }
|
||||||
],
|
],
|
||||||
"2025-08-15": [
|
"2025-08-15": [
|
||||||
|
{ "time": "20:00", "event": "Togafest", "price": "gratis" },
|
||||||
{ "time": "21:00", "event": "Allsangkaraoke", "price": "gratis" },
|
{ "time": "21:00", "event": "Allsangkaraoke", "price": "gratis" },
|
||||||
{ "time": "22:00", "event": "Afterparty", "price": "gratis" },
|
{ "time": "22:00", "event": "Afterparty", "price": "gratis" },
|
||||||
{ "time": "22:00", "event": "Silent Disco", "price": "gratis" }
|
{ "time": "22:00", "event": "Silent Disco", "price": "gratis" }
|
||||||
|
Reference in New Issue
Block a user