https://github.com/vria/date-republicain
Gregorian to republicain date converter
https://github.com/vria/date-republicain
france fun javascript javascript-library
Last synced: 4 months ago
JSON representation
Gregorian to republicain date converter
- Host: GitHub
- URL: https://github.com/vria/date-republicain
- Owner: vria
- License: mit
- Created: 2016-07-25T20:28:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T18:14:16.000Z (over 3 years ago)
- Last Synced: 2026-01-27T01:26:05.254Z (5 months ago)
- Topics: france, fun, javascript, javascript-library
- Language: JavaScript
- Size: 2.07 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# date-republicain
[](https://travis-ci.org/vria/date-republicain)
[](https://codecov.io/gh/vria/date-republicain)
This library is a gregorian to republicain date converter.
The French Republican Calendar (🇫🇷 Calendrier Républicain Français) or French Revolutionary Calendar
(🇫🇷: Calendrier Révolutionnaire Français), was a calendar created during the French Revolution and used by French
governments for about 12 years from 1793 to 1805. Read more about Republican Calendar in the
[dedicated article](https://en.wikipedia.org/wiki/French_Republican_Calendar).
This converter interpolates the Revolutionary Calendar after it was abolished in 1805 until nowadays and to future.
## Install
```
npm install date-republicain
```
## Use
The complied script [dist/date-republicain.js](dist/date-republicain.js) can be used in different environments.
It provides the function `getRepublicainDate(gregorianDate)` that returns corresponding republicain date.
`gregorianDate` argument is whatever [moment.js](http://momentjs.com/docs/) can parse.
Returned republicain date is an object with these methods:
- `day(): [number]` returns day number from 1 to 30. For "Jours complémentaires" it returns a value from 1 to 5
(from 1 to 6 for aleap year).
- `dayName(): [string]` each day in Republican Calendar is given a name: "Raisin", "Safran", "Châtaigne", ...,
"Jour des récompenses", "Jour de la révolution".
- `dayLink(): [string]` a Wikipedia link to corresponding `dayName()`.
- `month(): [number]` returns a number from 1 to 13. "1" corresponds to "Vendémiaire", "2" corresponds to "Brumaire",
..., "12" corresponds to "Fructidor", "13" corresponds to "Jours complémentaires".
- `monthName(): [string]` returns a month name ("Vendémiaire", "Brumaire", ..., "Jours complémentaires").
- `monthLink(): [string]` a Wikipedia link to corresponding `monthName()`.
- `year()[number]` returns a year of the Republican Era.
- `romainYear(): [string]` a year represented by Roman numerals.
#### Global function in browser
Don't forget to include `moment.js` before `date-republicain.js`.
```
<script src="path_to/date-republicain.js">
<script>
var republicainDate = getRepublicainDate("1792-09-22");
```
#### Node.js
Nodejs support will be added later.