Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,23 @@ date.all_quarter
date.all_year
----

=== Time Comparison

Use `past?` and `future?` methods instead of comparing time to the current time.

[source,ruby]
----
# bad
grand_opening_at < Time.current
public_release_at > Time.current

# good
grand_opening_at.past?
public_release_at.future?
----

NOTE: `before?` and `after?` methods can compare two arbitrary time objects.

== Duration

=== Duration Application
Expand Down