redbadger / website-next

DEPRECATED incarnation of Red Badger company site
https://redbadger.github.io/website-next/
6 stars 2 forks source link

Parse date and reset time #199

Closed asavin closed 8 years ago

asavin commented 8 years ago

tumblr_inline_oa9iltgx0y1raprkq_500

Motivation

When there is an event today but time is later than right now, dateFns.isWithinRange would take that time into account and would fail to identify that this event belongs to Today section.

Implementation

Because we are not using time of the event for sorting logic, the fix is to sanitate hours and minutes to 0:00. This also solves the issue when admin accidentally creates an event with end time earlier than start time.

This PR contains also #198 , and so #198 should be merged first.

Pre-flight checklist

jameshopkins commented 8 years ago

What's phantomJS being used for?

asavin commented 8 years ago

@jameshopkins quite possibly it was used for Karma tests, which are not run anymore. Need to do a major cleanup at some point.