Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for month constants #31218

Merged
merged 6 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
23 changes: 23 additions & 0 deletions stdlib/Dates/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,29 @@ Dates.dayofweek
Dates.dayofmonth
Dates.dayofweekofmonth
Dates.daysofweekinmonth
Dates.January
Dates.Jan
Dates.February
Dates.Feb
Dates.March
Dates.Mar
Dates.April
Dates.Apr
Dates.May
Dates.June
Dates.Jun
Dates.July
Dates.Jul
Dates.August
Dates.Aug
Dates.September
Dates.Sep
Dates.October
Dates.Oct
Dates.November
Dates.Nov
Dates.December
Dates.Dec
Dates.monthname
Dates.monthabbr
Dates.daysinmonth
Expand Down
301 changes: 298 additions & 3 deletions stdlib/Dates/src/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,304 @@ function daysofweekinmonth(dt::TimeType)
end

### Months
const January, February, March, April, May, June = 1, 2, 3, 4, 5, 6
const July, August, September, October, November, December = 7, 8, 9, 10, 11, 12
const Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
"""
January

The first month of the year.

# Examples
```jldoctest
julia> January
1
```
"""
const January = 1

"""
Jan

Abrreviation for [`January`](@ref).

# Examples
```jldoctest
julia> Jan
1
```
"""
const Jan = 1

"""
February

The second month of the year.

# Examples
```jldoctest
julia> February
2
```
"""
const February = 2

"""
Feb

Abrreviation for [`February`](@ref).

# Examples
```jldoctest
julia> Feb
2
```
"""
const Feb = 2

"""
March

The third month of the year.

# Examples
```jldoctest
julia> March
3
```
"""
const March = 3

"""
Mar

Abrreviation for [`March`](@ref).

# Examples
```jldoctest
julia> Mar
3
```
"""
const Mar = 3

"""
April

The fourth month of the year.

# Examples
```jldoctest
julia> April
4
```
"""
const April = 4

"""
Apr

Abrreviation for [`April`](@ref).

# Examples
```jldoctest
julia> Apr
4
```
"""
const Apr = 4

"""
May

The fifth month of the year.

# Examples
```jldoctest
julia> May
5
```
"""
const May = 5

"""
June

The sixth month of the year.

# Examples
```jldoctest
julia> June
6
```
"""
const June = 6

"""
Jun

Abrreviation for [`June`](@ref).

# Examples
```jldoctest
julia> Jun
6
```
"""
const Jun = 6

"""
July

The seventh month of the year.

# Examples
```jldoctest
julia> July
7
```
"""
const July = 7

"""
Jul

Abrreviation for [`July`](@ref).

# Examples
```jldoctest
julia> Jul
7
```
"""
const Jul = 7

"""
August

The eighth month of the year.

# Examples
```jldoctest
julia> August
8
```
"""
const August = 8

"""
Aug

Abrreviation for [`August`](@ref).

# Examples
```jldoctest
julia> Aug
8
```
"""
const Aug = 8

"""
September

The ninth month of the year.

# Examples
```jldoctest
julia> September
9
```
"""
const September = 9

"""
Sep

Abrreviation for [`September`](@ref).

# Examples
```jldoctest
julia> Sep
9
```
"""
const Sep = 9

"""
October

The tenth month of the year.

# Examples
```jldoctest
julia> October
10
```
"""
const October = 10

"""
Oct

Abrreviation for [`October`](@ref).

# Examples
```jldoctest
julia> Oct
10
```
"""
const Oct = 10

"""
November

The eleventh month of the year.

# Examples
```jldoctest
julia> November
11
```
"""
const November = 11

"""
Nov

Abrreviation for [`November`](@ref).

# Examples
```jldoctest
julia> Nov
11
```
"""
const Nov= 11

"""
December

The last month of the year.

# Examples
```jldoctest
julia> December
12
```
"""
const December = 12

"""
Dec

Abrreviation for [`December`](@ref).

# Examples
```jldoctest
julia> Dec
12
```
"""
const Dec = 12

monthname(month::Integer, locale::DateLocale) = locale.months[month]
monthabbr(month::Integer, locale::DateLocale) = locale.months_abbr[month]
Expand Down