Skip to content

Commit 13baeb5

Browse files
Mention alternatives to DateTime.compare/2 for comparison (#14147)
1 parent dcc27c2 commit 13baeb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/elixir/lib/calendar/datetime.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ defmodule DateTime do
1313
1414
Remember, comparisons in Elixir using `==/2`, `>/2`, `</2` and friends
1515
are structural and based on the DateTime struct fields. For proper
16-
comparison between datetimes, use the `compare/2` function. The
17-
existence of the `compare/2` function in this module also allows
16+
comparison between datetimes, use the `compare/2`, `after?/2` and `before?/2` functions.
17+
The existence of the `compare/2` function in this module also allows
1818
using `Enum.min/2` and `Enum.max/2` functions to get the minimum and
1919
maximum datetime of an `Enum`. For example:
2020

0 commit comments

Comments
 (0)