https://github.com/mcorrell/repubdate
Date conversion and display for the French Republican Calendar
https://github.com/mcorrell/repubdate
date date-formatting equality fraternity liberty
Last synced: 11 months ago
JSON representation
Date conversion and display for the French Republican Calendar
- Host: GitHub
- URL: https://github.com/mcorrell/repubdate
- Owner: mcorrell
- License: mit
- Created: 2017-07-19T21:08:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-08T23:55:09.000Z (about 7 years ago)
- Last Synced: 2024-04-24T18:55:30.512Z (almost 2 years ago)
- Topics: date, date-formatting, equality, fraternity, liberty
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# repubdate
A package to allow Javscript Date objects to report the date in the style of the [French Republican Calendar](https://en.wikipedia.org/wiki/French_Republican_Calendar). The calendar was active for only twelve years, from 1793-1805, and it is unclear how it was meant to be extended to the current day. We use the [Romme System](https://en.wikipedia.org/wiki/French_Republican_Calendar#Converting_from_the_Gregorian_Calendar) to calculate the date for years outside of the bounds of the extant use of the calendar.
## Installation ##
Install using `npm`:
$ npm install repubdate
## Usage ##
repubdate creates a method, `toRevolutionaryString`, in the standard javascript Date object.
```javascript
require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString());
//outputs "18 Brumaire, an VIII
```
`toRevolutionaryString` can take an optional `mode` parameter, for other formats.
`short` uses short names for the months.
```javascript
require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("short"));
//outputs "18 Bru, VIII"
```
`verbose` uses the full name, includes the name of the day within the Décade, as well as the item, animal, or plant that is to be celebrated on that day.
```javascript
require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("verbose"));
//outputs "Octidi 18 Brumaire, année de la République VIII, le jour du Dentelaire"
```
`english` is the verbose string, but in English rather than French.
```javascript
require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("english"));
//outputs "Octidi 18 Brumaire, year of the Republic VIII, the day of the Leadworts"
```
`numeric` is a short version in DD/MM/YY format.
```javascript
require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("numeric"));
//outputs "18/2/8"
```