File tree 3 files changed +12
-10
lines changed
3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ defmodule Date do
31
31
32
32
Comparisons in Elixir using `==/2`, `>/2`, `</2` and similar are structural
33
33
and based on the `Date` struct fields. For proper comparison between
34
- dates, use the `compare/2` function. The existence of the `compare/2`
35
- function in this module also allows using `Enum.min/2` and `Enum.max/2`
36
- functions to get the minimum and maximum date of an `Enum`. For example:
34
+ dates, use the `compare/2`, `after?/2` and `before?/2` functions.
35
+ The existence of the `compare/2` function in this module also allows
36
+ using `Enum.min/2` and `Enum.max/2` functions to get the minimum and
37
+ maximum date of an `Enum`. For example:
37
38
38
39
iex> Enum.min([~D[2017-03-31], ~D[2017-04-01]], Date)
39
40
~D[2017-03-31]
Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ defmodule NaiveDateTime do
36
36
37
37
Comparisons in Elixir using `==/2`, `>/2`, `</2` and similar are structural
38
38
and based on the `NaiveDateTime` struct fields. For proper comparison
39
- between naive datetimes, use the `compare/2` function. The existence of the
40
- `compare/2` function in this module also allows using `Enum.min/2` and
41
- `Enum.max/2` functions to get the minimum and maximum naive datetime of an
42
- `Enum`. For example:
39
+ between naive datetimes, use the `compare/2`, `after?/2` and `before?/2` functions.
40
+ The existence of the `compare/2` function in this module also allows
41
+ using `Enum.min/2` and `Enum. max/2` functions to get the minimum and
42
+ maximum naive datetime of an `Enum`. For example:
43
43
44
44
iex> Enum.min([~N[2020-01-01 23:00:07], ~N[2000-01-01 23:00:07]], NaiveDateTime)
45
45
~N[2000-01-01 23:00:07]
Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ defmodule Time do
31
31
32
32
Comparisons in Elixir using `==/2`, `>/2`, `</2` and similar are structural
33
33
and based on the `Time` struct fields. For proper comparison between
34
- times, use the `compare/2` function. The existence of the `compare/2`
35
- function in this module also allows using `Enum.min/2` and `Enum.max/2`
36
- functions to get the minimum and maximum time of an `Enum`. For example:
34
+ times, use the `compare/2`, `after?/2` and `before?/2` functions.
35
+ The existence of the `compare/2` function in this module also allows
36
+ using `Enum.min/2` and `Enum.max/2` functions to get the minimum and
37
+ maximum time of an `Enum`. For example:
37
38
38
39
iex> Enum.min([~T[23:00:07.001], ~T[10:00:07.001]], Time)
39
40
~T[10:00:07.001]
You can’t perform that action at this time.
0 commit comments