Comparing dates and time gives me a headache every single time and I need to resolve to drawing timelines in order to determine if the > sign means that a date is in the future or the past in relation to the other one.
This little gem adds several helper predicates to Time and Date classes (and all classes that inherit from them, e.g. DateTime in rails), that help in writing and reading such conditions.
$ gem install time-predicates
or add to your
Following predicate methods are available:
The method names are pretty self-explanatory.
Copyright (c) 2016 Szymon Szeliga
See LICENSE for details.