From c23e365e4f25bad222fa7df9666f7edd3ffcf66e Mon Sep 17 00:00:00 2001 From: eulerkochy Date: Fri, 1 Mar 2019 11:03:02 +0530 Subject: [PATCH 1/5] Update documentation for month constants --- stdlib/Dates/docs/src/index.md | 23 +++ stdlib/Dates/src/query.jl | 301 ++++++++++++++++++++++++++++++++- 2 files changed, 321 insertions(+), 3 deletions(-) diff --git a/stdlib/Dates/docs/src/index.md b/stdlib/Dates/docs/src/index.md index c8529438beabc..9d845ce8af9ea 100644 --- a/stdlib/Dates/docs/src/index.md +++ b/stdlib/Dates/docs/src/index.md @@ -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 diff --git a/stdlib/Dates/src/query.jl b/stdlib/Dates/src/query.jl index cbad78689e62c..04f99615e20e7 100644 --- a/stdlib/Dates/src/query.jl +++ b/stdlib/Dates/src/query.jl @@ -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] From b1dd6db0d3683ebd2796fa945a4374ea44a752e0 Mon Sep 17 00:00:00 2001 From: eulerkochy Date: Fri, 1 Mar 2019 14:06:14 +0530 Subject: [PATCH 2/5] Fix a bug in docstrings --- stdlib/Dates/src/query.jl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/stdlib/Dates/src/query.jl b/stdlib/Dates/src/query.jl index 04f99615e20e7..acfb94e83a61c 100644 --- a/stdlib/Dates/src/query.jl +++ b/stdlib/Dates/src/query.jl @@ -242,7 +242,7 @@ const January = 1 """ Jan -Abrreviation for ['January'](@ref). +Abrreviation for [`January`](@ref). # Examples ```jldoctest @@ -268,7 +268,7 @@ const February = 2 """ Feb -Abrreviation for ['February'](@ref). +Abrreviation for [`February`](@ref). # Examples ```jldoctest @@ -294,7 +294,7 @@ const March = 3 """ Mar -Abrreviation for ['March'](@ref). +Abrreviation for [`March`](@ref). # Examples ```jldoctest @@ -320,7 +320,7 @@ const April = 4 """ Apr -Abrreviation for ['April'](@ref). +Abrreviation for [`April`](@ref). # Examples ```jldoctest @@ -359,7 +359,7 @@ const June = 6 """ Jun -Abrreviation for ['June'](@ref). +Abrreviation for [`June`](@ref). # Examples ```jldoctest @@ -385,7 +385,7 @@ const July = 7 """ Jul -Abrreviation for ['July'](@ref). +Abrreviation for [`July`](@ref). # Examples ```jldoctest @@ -411,7 +411,7 @@ const August = 8 """ Aug -Abrreviation for ['August'](@ref). +Abrreviation for [`August`](@ref). # Examples ```jldoctest @@ -437,7 +437,7 @@ const September = 9 """ Sep -Abrreviation for ['September'](@ref). +Abrreviation for [`September`](@ref). # Examples ```jldoctest @@ -463,7 +463,7 @@ const October = 10 """ Oct -Abrreviation for ['October'](@ref). +Abrreviation for [`October`](@ref). # Examples ```jldoctest @@ -489,7 +489,7 @@ const November = 11 """ Nov -Abrreviation for ['November'](@ref). +Abrreviation for [`November`](@ref). # Examples ```jldoctest @@ -515,7 +515,7 @@ const December = 12 """ Dec -Abrreviation for ['December'](@ref). +Abrreviation for [`December`](@ref). # Examples ```jldoctest From 9d916672cd96dce7d202823f442da1633cc8693d Mon Sep 17 00:00:00 2001 From: Koustav Chowdhury Date: Fri, 1 Mar 2019 16:43:27 +0530 Subject: [PATCH 3/5] Updated as per review --- stdlib/Dates/docs/src/index.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/stdlib/Dates/docs/src/index.md b/stdlib/Dates/docs/src/index.md index 9d845ce8af9ea..c8529438beabc 100644 --- a/stdlib/Dates/docs/src/index.md +++ b/stdlib/Dates/docs/src/index.md @@ -710,29 +710,6 @@ 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 From e24d6c00e92ba2d36cfd43c091e6c972d35d5826 Mon Sep 17 00:00:00 2001 From: eulerkochy Date: Sat, 2 Mar 2019 07:34:19 +0530 Subject: [PATCH 4/5] Fix a typo --- stdlib/Dates/src/query.jl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/stdlib/Dates/src/query.jl b/stdlib/Dates/src/query.jl index acfb94e83a61c..87af6ae6483ce 100644 --- a/stdlib/Dates/src/query.jl +++ b/stdlib/Dates/src/query.jl @@ -242,7 +242,7 @@ const January = 1 """ Jan -Abrreviation for [`January`](@ref). +Abbreviation for [`January`](@ref). # Examples ```jldoctest @@ -268,7 +268,7 @@ const February = 2 """ Feb -Abrreviation for [`February`](@ref). +Abbreviation for [`February`](@ref). # Examples ```jldoctest @@ -294,7 +294,7 @@ const March = 3 """ Mar -Abrreviation for [`March`](@ref). +Abbreviation for [`March`](@ref). # Examples ```jldoctest @@ -320,7 +320,7 @@ const April = 4 """ Apr -Abrreviation for [`April`](@ref). +Abbreviation for [`April`](@ref). # Examples ```jldoctest @@ -359,7 +359,7 @@ const June = 6 """ Jun -Abrreviation for [`June`](@ref). +Abbreviation for [`June`](@ref). # Examples ```jldoctest @@ -385,7 +385,7 @@ const July = 7 """ Jul -Abrreviation for [`July`](@ref). +Abbreviation for [`July`](@ref). # Examples ```jldoctest @@ -411,7 +411,7 @@ const August = 8 """ Aug -Abrreviation for [`August`](@ref). +Abbreviation for [`August`](@ref). # Examples ```jldoctest @@ -437,7 +437,7 @@ const September = 9 """ Sep -Abrreviation for [`September`](@ref). +Abbreviation for [`September`](@ref). # Examples ```jldoctest @@ -463,7 +463,7 @@ const October = 10 """ Oct -Abrreviation for [`October`](@ref). +Abbreviation for [`October`](@ref). # Examples ```jldoctest @@ -489,7 +489,7 @@ const November = 11 """ Nov -Abrreviation for [`November`](@ref). +Abbreviation for [`November`](@ref). # Examples ```jldoctest @@ -515,7 +515,7 @@ const December = 12 """ Dec -Abrreviation for [`December`](@ref). +Abbreviation for [`December`](@ref). # Examples ```jldoctest From 0b9a5a0400546d599c8e3f445c8105e17da06a4a Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Sun, 3 Mar 2019 23:56:07 +0530 Subject: [PATCH 5/5] Update stdlib/Dates/src/query.jl Co-Authored-By: eulerkochy --- stdlib/Dates/src/query.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Dates/src/query.jl b/stdlib/Dates/src/query.jl index 87af6ae6483ce..3004f7bb88c7d 100644 --- a/stdlib/Dates/src/query.jl +++ b/stdlib/Dates/src/query.jl @@ -497,7 +497,7 @@ julia> Nov 11 ``` """ -const Nov= 11 +const Nov = 11 """ December