diff --git a/src/pages/spectacles/[id].astro b/src/pages/spectacles/[id].astro index 59eec1d..d3cd0a0 100644 --- a/src/pages/spectacles/[id].astro +++ b/src/pages/spectacles/[id].astro @@ -43,6 +43,9 @@ if (liveStory) { if (!spectacle) { return Astro.redirect('/spectacles/'); } + +const now = new Date(); +upcomingDates = upcomingDates.filter(event => new Date(event.date) >= now); --- @@ -118,28 +121,9 @@ if (!spectacle) { - - {spectacle.gallery.length > 0 && ( -
-

Galerie

-
- {spectacle.gallery.map((img, index) => ( -
- {`${spectacle.title} -
- ))} -
-
- )} - {upcomingDates.length > 0 && ( -
+

Prochaines dates

{upcomingDates.map(event => { @@ -180,6 +164,25 @@ if (!spectacle) {
)} + + + {spectacle.gallery.length > 0 && ( +
+

Galerie

+
+ {spectacle.gallery.map((img, index) => ( +
+ {`${spectacle.title} +
+ ))} +
+
+ )}