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
19 changes: 19 additions & 0 deletions lib/calendar/date.ex
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,25 @@ defmodule Calendar.Date do
"""
def sunday?(date), do: day_of_week(date) == 7

@doc """
The name of the month as a string.
Takes a language code as the second argument. Defaults to :en for English.

## Examples

iex> {2015, 7, 6} |> month_name # July
"July"
iex> {2015, 2, 7} |> month_name # February
"February"
iex> {2015, 11, 5} |> month_name # November
"November"
"""
def month_name(date, lang \\ :en) do
date
|> contained_date
|> Calendar.Strftime.strftime!("%B", lang)
end

@doc """

## Examples
Expand Down