-
Notifications
You must be signed in to change notification settings - Fork 48
[DOC] New doc about Julian/Gregorian #70
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
Changes from all commits
540971a
4f2b807
d8e8ee3
45002f7
ae64281
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| README.md | ||
| ext/date/*.[ch] | ||
| lib/date.rb | ||
| doc/date/* | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| /.bundle/ | ||
| /Gemfile.lock | ||
| /coverage/ | ||
| /doc/ | ||
| /pkg/ | ||
| *.bundle | ||
| *.dll | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| == Julian and Gregorian Calendars | ||
|
|
||
| The difference between the | ||
| {Julian calendar}[https://en.wikipedia.org/wiki/Julian_calendar] | ||
| and the | ||
| {Gregorian calendar}[https://en.wikipedia.org/wiki/Gregorian_calendar] | ||
| may matter to your program if it uses dates in the interval: | ||
|
|
||
| - October 15, 1582. | ||
| - September 14, 1752. | ||
|
|
||
| A date outside that interval (including all dates in modern times) | ||
| is the same in both calendars. | ||
| However, a date _within_ that interval will be different | ||
| in the two calendars. | ||
|
|
||
| === Different Calendar, Different \Date | ||
|
|
||
| The reason for the difference is this: | ||
|
|
||
| - On October 15, 1582, several countries changed | ||
| from the Julian calendar to the Gregorian calendar; | ||
| these included Italy, Poland, Portugal, and Spain. | ||
| Other contries in the Western world retained the Julian calendar. | ||
| - On September 14, 1752, most of the British empire | ||
| changed from the Julian calendar to the Gregorian calendar. | ||
|
|
||
| When your code uses a date in this "gap" interval, | ||
| it will matter whether it considers the switchover date | ||
| to be the earlier date or the later date (or neither). | ||
|
Comment on lines
+28
to
+30
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this sentence will need to refine too. |
||
|
|
||
| === Argument +start+ | ||
|
|
||
| Certain methods in class \Date handle differences in the | ||
| {Julian and Gregorian calendars}[rdoc-ref:calendars.rdoc@Julian+and+Gregorian+Calendars] | ||
| by accepting an optional argument +start+, whose value may be: | ||
|
|
||
| - Date::ITALY (the default): the created date is Julian | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These constants are no longer links.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that, too. Should RDoc have linked to the constants?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this commit, that is
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bug of RDoc.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I link manually, as a stop-gap? |
||
| if before October 15, 1582, Gregorian otherwise: | ||
|
|
||
| d = Date.new(1582, 10, 15) | ||
| d.prev_day.julian? # => true | ||
| d.julian? # => false | ||
| d.gregorian? # => true | ||
|
|
||
| - Date::ENGLAND: the created date is Julian if before September 14, 1752, | ||
| Gregorian otherwise: | ||
|
|
||
| d = Date.new(1752, 9, 14, Date::ENGLAND) | ||
| d.prev_day.julian? # => true | ||
| d.julian? # => false | ||
| d.gregorian? # => true | ||
|
|
||
| - Date::JULIAN: the created date is Julian regardless of its value: | ||
|
|
||
| d = Date.new(1582, 10, 15, Date::JULIAN) | ||
| d.julian? # => true | ||
|
|
||
| - Date::GREGORIAN: the created date is Gregorian regardless of its value: | ||
|
|
||
| d = Date.new(1752, 9, 14, Date::GREGORIAN) | ||
| d.prev_day.gregorian? # => true | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is totally wrong.
This "interval" is the duration a date is represented differently across countries.
Gregorian calendar has never match Julian calendar since its creation (except for 3C in proleptic Gregorian calendar).
If the two calendars were match since 16C or 19C, why they needed switch it?