Skip to content

Conversation

@optilude
Copy link
Contributor

The code only checked for month, not year, so an event spanning across the new year would potentially be hidden/shown when it shouldn't be.

Also, there's a problem whereby the splitting of the date string will result in some numbers being strings, so use parseInt() just in case (I was having a hard time with === compares!)

Date maths is hard. :)

If you have an event that finishes in an earlier month in a later year, it could be hidden by the previous logic.

Feels like it should be possible to do this with moment().isBetween(), but it kind of gets a bit tricky because we don't check against a specific day.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant