'scuse the upper case, they are constants.
I am having fun learning ruby's Date helpers.
1.9.3p125 :057 > Date::ABBR_MONTHNAMES
=> [nil, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
1.9.3p125 :058 > Date::ABBR_DAYNAMES
=> ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
1.9.3p125 :059 > Date::MONTHNAMES
=> [nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
1.9.3p125 :060 > Date::DAYNAMES
=> ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
1.9.3p125 :070 > Date::MONTHNAMES[Time.new.month]
=> "August"
Fun stuff! But what about the GREGORIAN, JULIAN, ENGLAND and ITALY (!) constants. What are they for / how do I use them? I can output:
1.9.3p125 :061 > Date::GREGORIAN
=> -Infinity
1.9.3p125 :062 > Date::JULIAN
=> Infinity
1.9.3p125 :063 > Date::ENGLAND
=> 2361222
or
1.9.3p125 :067 > Date.new
=> #<Date: -4712-01-01 ((0j,0s,0n),+0s,2299161j)>
1.9.3p125 :068 > Date.new.new_start(Date::JULIAN)
=> #<Date: -4712-01-01 ((0j,0s,0n),+0s,Infj)>
1.9.3p125 :069 > Date.new.new_start(Date::ENGLAND)
=> #<Date: -4712-01-01 ((0j,0s,0n),+0s,2361222j)>
From the following it looks like Julian is a calendar that is off by a few days. I remember learning about the calendar reset for that a few centuries ago so that makes sense, however the ENGLAND and ITALY and how they would be used is still unclear to me.
1.9.3p125 :076 > Date.new(1977,7,1).new_start(Date::ENGLAND)
=> #<Date: 1977-07-01 ((2443326j,0s,0n),+0s,2361222j)>
1.9.3p125 :077 > Date.new(1977,7,1).new_start(Date::ITALY)
=> #<Date: 1977-07-01 ((2443326j,0s,0n),+0s,2299161j)>
1.9.3p125 :078 > Date.new(1977,7,1).new_start(Date::JULIAN)
=> #<Date: 1977-06-18 ((2443326j,0s,0n),+0s,Infj)>