asgardia-calendar-converter
Convert dates between ISO (Gregorian) calendar and proposed Asgardian calendar back and forth
Leap Days
Per Decree #2:
The question of adding an extra day in a leap year will be addressed separately.
This means that any date outside 2017 can be affected by the later-proposed leap day adaptation. I've come up with three different approaches that I find to be the most likely:
"feb"
: Leap Day is included between February and March (similar to ISO calendar)"jun"
: Leap Day is included between June and Asgard (similar to original International Fixed Calendar)"non"
: no Leap Day is ever included
Use the keyword of your selected mode in all calls to convert functions (see API).
Install
npm install --save asgardia-calendar-converter
Usage
Import:
;
or require:
const toAsgardian toGregorian = ;
and use the provided functions:
console; // logs {day: 14, month: 7, year: 1}console; // logs {day: 21, month: 5, year: 2017}
API
Datum
toAsgardian
;
datum
: ISODatum
object to be converted to Asgardianmode
: Leap-day mode to be used (see Leap Days)
toGregorian
;
datum
: AsgardianDatum
object to be converted to ISOmode
: Leap-day mode to be used (see Leap Days)
isAsgardianYearLeap
;
year
: Asgardian year to be checked whether it is leap or not
isGregorianYearLeap
;
year
: ISO year to be checked whether it is leap or not
Development
Clone the repo and install dev-dependencies:
git clone url/of/your/forkcd path/to/your/clonenpm install
Compile files from src
to dist
:
npm run build
Watch src
and compile files from there to dist
on change:
npm run watch
Run tests:
npm test
Compile files for demo to out
:
npm run build-demo