Skip to content

JavaScript/TypeScript library for converting/calculating Roman and Easter date

Notifications You must be signed in to change notification settings

UUDigitalHumanitieslab/historical-dates

Repository files navigation

Historical Dates

DOI NPM Master: Build Status Develop: Build Status

JavaScript/TypeScript library for converting/calculating Roman and Easter dates. Based on Axel Findling's Roman date converter and Nikolaus A. Bär's easter date calculator.

Friend: Do dates make you nervous?
Me: omg yes especially when doing math across timezone boundaries

— Daniel Cousineau (@dcousineau) August 3, 2016

Get Started

npm install historical-dates

Determining the dates of Easter

import { calcEaster } from 'historical-dates';

let easter = calcEaster(1400, 'julian');
console.log(easter.sunday);
// 1400-4-18 (Julian)

Parsing Plain dates

Many formats are supported, see the common.spec.ts test file for an overview.

import { parseDateString } from 'historical-dates';

let plainDate = parseDateString('XI. Junii Anno MDCXXXVII.', 'gregorian');
console.log(plainDate);
// 1637-6-11

Parsing Roman dates

import { RomanDate } from 'historical-dates';

let romanDate = RomanDate.fromString('prid kal. mar mdc', 'gregorian');
console.log(romanDate);
// pridie Kal. Mart. MDC
console.log(romanDate.toDate());
// 1600-2-28

Converting Julian and Gregorian dates

import { createDate } from 'historical-dates';

let julianDate = createDate(1582, 10, 5, 'julian');
let gregorianDate = julianDate.toGregorian();
console.log(gregorianDate);
// 1582-10-15

About

JavaScript/TypeScript library for converting/calculating Roman and Easter date

Resources

Stars

Watchers

Forks

Packages

No packages published