type

Month

src @Serializable { simple=true }
enum class Month : Enum

Enum for twelve months of the year.

enum

jan

January

feb

February

mar

March

apr

April

may

May

jun

June

jul

July

aug

August

sep

September

oct

October

nov

November

dec

December

constructors

fromStr

Return the Month instance for the specified name.

fields

vals

List of Month values indexed by ordinal

methods

decrement

Return the month before this month.

increment

Return the month after this month.

localeAbbr

Get the abbreviated name for the current locale.

localeFull

Get the full name for the current locale.

numDays

Return the number of days in this month for the specified year.

toLocale

Return the month as a localized string according to the specified pattern.

Slot Details

apr

src const static Month apr := ...

April

aug

src const static Month aug := ...

August

dec

src const static Month dec := ...

December

decrement

src @Operator
Month decrement()

Return the month before this month.

feb

src const static Month feb := ...

February

fromStr

src static new fromStr(Str name, Bool checked := true)

Return the Month instance for the specified name. If not a valid name and checked is false return null, otherwise throw ParseErr.

increment

src @Operator
Month increment()

Return the month after this month.

jan

src const static Month jan := ...

January

jul

src const static Month jul := ...

July

jun

src const static Month jun := ...

June

localeAbbr

src Str localeAbbr()

Get the abbreviated name for the current locale. Configured by the sys::<name>Abbr localized property.

localeFull

src Str localeFull()

Get the full name for the current locale. Configured by the sys::<name>Full localized property.

mar

src const static Month mar := ...

March

may

src const static Month may := ...

May

nov

src const static Month nov := ...

November

numDays

src Int numDays(Int year)

Return the number of days in this month for the specified year.

oct

src const static Month oct := ...

October

sep

src const static Month sep := ...

September

toLocale

src Str toLocale(Str? pattern := null, Locale locale := Locale.cur())

Return the month as a localized string according to the specified pattern. The pattern rules are a subset of the DateTime.toLocale:

M      One/two digit month        6, 11
MM     Two digit month            06, 11
MMM    Three letter abbr month    Jun, Nov
MMMM   Full month name            June, November

If pattern is null it defaults to "MMM". Also see localeAbbr and localeFull.

vals

src const static Month[] vals := ...

List of Month values indexed by ordinal