mirror of
https://github.com/UiO-Gaming/uiogaming.no.git
synced 2026-11-05 13:56:47 +01:00
fix: filter function not working in firefox
This commit is contained in:
3 files changed
+9
-2
No files matched your search
@@ -15,6 +15,7 @@
|
||||
"gatsby-source-filesystem": "^3.7.1",
|
||||
"gatsby-source-sanity": "^7.0.4",
|
||||
"gatsby-transformer-sharp": "^3.7.1",
|
||||
"moment": "^2.29.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as styles from "./events.module.css"
|
||||
|
||||
import { Link, graphql, useStaticQuery } from "gatsby"
|
||||
import { GatsbyImage } from "gatsby-plugin-image"
|
||||
import moment from "moment"
|
||||
|
||||
import { FaMapMarkerAlt, FaCalendarAlt } from "react-icons/fa"
|
||||
|
||||
@@ -35,13 +36,18 @@ const Events = () => {
|
||||
}
|
||||
`)
|
||||
|
||||
const currentDate = new Date()
|
||||
|
||||
return (
|
||||
<section className={styles.stretch}>
|
||||
<div className={styles.container}>
|
||||
<h2 className={styles.sectionHeader}>Hva skjer?</h2>
|
||||
<div className={styles.events}>
|
||||
{data.allSanityEvent.edges
|
||||
.filter(({ node }) => new Date(node.date).getTime() > Date.now())
|
||||
.filter(({ node: event }) => {
|
||||
const eventDate = event.date.split(" ").slice(1).join(" ")
|
||||
return currentDate < moment(eventDate, "D. MMM Y")
|
||||
})
|
||||
.slice(0, 2)
|
||||
.map(({ node: event }) => (
|
||||
<Link to={"event/" + event.slug.current}>
|
||||
|
||||
@@ -8768,7 +8768,7 @@ mkdirp@^1.0.4:
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
|
||||
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
||||
|
||||
moment@^2.27.0:
|
||||
moment@^2.27.0, moment@^2.29.1:
|
||||
version "2.29.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
|
||||
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
|
||||
|
||||
Reference in new issue
Block a user