Day of the week: Difference between revisions

Content added Content deleted
(→‎{{header|Elixir}}: use Date module)
Line 1,023: Line 1,023:


=={{header|Elixir}}==
=={{header|Elixir}}==
{{works with|Elixir|1.4}}
<lang elixir>Enum.each(2008..2121, fn year ->
<lang elixir>Enum.each(2008..2121, fn year ->
wday = :calendar.day_of_the_week(year, 12, 25)
wday = Date.from_erl!({year, 12, 25}) |> Date.day_of_week
if wday==7, do: IO.puts "25 December #{year} is sunday"
if wday==7, do: IO.puts "25 December #{year} is sunday"
end)</lang>
end)</lang>