summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei Magusev <lexmag@me.com>2016-09-20 23:40:52 +0200
committerAleksei Magusev <lexmag@me.com>2016-09-21 23:41:00 +0200
commitfdf1348fcba8620ffb3a9d105bad718e08876535 (patch)
treec4fe14234512fb746ff592644d7248209a46e686
parent9cd972dbde52068e30a7cb61a5344c9f5c274bd0 (diff)
downloadelixir-fdf1348fcba8620ffb3a9d105bad718e08876535.tar.gz
Simplify Calendar.ISO.last_day_of_month/2 definition
-rw-r--r--lib/elixir/lib/calendar/iso.ex5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/elixir/lib/calendar/iso.ex b/lib/elixir/lib/calendar/iso.ex
index 6f28e06df..7f91b84bb 100644
--- a/lib/elixir/lib/calendar/iso.ex
+++ b/lib/elixir/lib/calendar/iso.ex
@@ -62,10 +62,7 @@ defmodule Calendar.ISO do
def last_day_of_month(year, 2) do
if leap_year?(year), do: 29, else: 28
end
- def last_day_of_month(_, 4), do: 30
- def last_day_of_month(_, 6), do: 30
- def last_day_of_month(_, 9), do: 30
- def last_day_of_month(_,11), do: 30
+ def last_day_of_month(_, month) when month in [4, 6, 9, 11], do: 30
def last_day_of_month(_, month) when month in 1..12, do: 31
@doc """