Skip to content

Commit

Permalink
Define Anno Mundi #16
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroe committed Mar 8, 2022
1 parent 34f684a commit ebccfdd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
11 changes: 8 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# era (development version)

* New year units: sidereal, tropical, and anomalistic astronomic years #15
* More precise epoch value for Hijri eras: `621.5394` instead of `622`.
* More precise epoch value for Nowruz (Solar Hijri) eras: `621.2218` instead of `622`.
* New eras:
* Anno Mundi (Hebrew calendar)
* New year units:
* Sidereal, tropical, and anomalistic astronomic years #15
* Hebrew lunisolar years
* Changes to existing eras:
* More precise epoch value for Hijri eras: `621.5394` instead of `622`.
* More precise epoch value for Nowruz (Solar Hijri) eras: `621.2218` instead of `622`.
* `this_year()` now considers the current date, returns a floored integer (i.e. the actual current calendar year), and is vectorised over `era`.
* Class constructors `era()` and `yr()` return a zero-length vector when called with no arguments (instead of an error), allowing them to be used as [prototypes](https://vctrs.r-lib.org/articles/type-size.html)
* `era_yr` objects can be cast to character vectors (e.g. `as.character(yr(1, "BP"))`)
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
5 changes: 5 additions & 0 deletions data-raw/era_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ library("usethis")
hijra <- era:::frac_year(as.Date("622-07-16")) - 1
# Hijra (Nowruz) <https://web.archive.org/web/20050311055900/http://wwwusr.obspm.fr/~heydari/divers/ir-cal-eng.html>
nhijra <- era:::frac_year(as.Date("622-03-22")) - 1
# Era Mundi
mundi <- era:::frac_year(as.Date("1-10-6")) - 3762

# Year units
# Mostly from https://en.wikipedia.org/wiki/Year
Expand All @@ -17,6 +19,7 @@ julian <- era_year("Julian", 365.25)
solar <- era_year("solar", 365.24219)
islamic_lunar <- era_year("Islamic lunar", 354.36708)
nowruz <- era_year("Nowruz", 365.2424) # https://web.archive.org/web/20050311055900/http://wwwusr.obspm.fr/~heydari/divers/ir-cal-eng.html
hebrew <- era_year("Hebrew lunisolar", 365 + (24311/98496)) # http://individual.utoronto.ca/kalendis/hebrew/Hebrew-Possible-Weekdays-view.htm
radiocarbon <- era_year("radiocarbon", NA)
sidereal <- era_year("sidereal", 365.256363004)
tropical <- era_year("tropical", 365.24219)
Expand Down Expand Up @@ -66,6 +69,8 @@ era_table <- tribble(
"BH", hijra, "Before the Hijra", islamic_lunar, 1L, -1,
"SH", nhijra, "Solar Hijri", nowruz, 1L, 1,
"BSH", nhijra, "Before Solar Hijri", nowruz, 1L, -1,
# Jewish calendars
"AM", mundi, "Anno Mundi", hebrew, 1L, 1,
# Historic calendars
# Ancient calendars
# Quirky calendars
Expand Down
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Anno
Mundi
Codecov
Hijri
Hijri’
Expand Down

0 comments on commit ebccfdd

Please sign in to comment.