Module: Inq::DateTimeHelpers
- Included in:
- Sources::Github::IssueFetcher, Sources::Github::Issues
- Defined in:
- lib/inq/date_time_helpers.rb
Overview
Various helper functions for working with DateTime objects.
Instance Method Summary collapse
-
#date_ge(left, right) ⇒ Boolean
Check if
left
is greater than or equal toright
, where both are string representations of a date. -
#date_le(left, right) ⇒ Boolean
Check if
left
is less than or equal toright
, where both are string representations of a date.
Instance Method Details
#date_ge(left, right) ⇒ Boolean
Check if left
is greater than or equal to right
, where both are string representations of a date.
31 32 33 34 35 36 |
# File 'lib/inq/date_time_helpers.rb', line 31 def date_ge(left, right) left = str_to_dt(left) right = str_to_dt(right) left >= right end |
#date_le(left, right) ⇒ Boolean
Check if left
is less than or equal to right
, where both are string representations of a date.
17 18 19 20 21 22 |
# File 'lib/inq/date_time_helpers.rb', line 17 def date_le(left, right) left = str_to_dt(left) right = str_to_dt(right) left <= right end |