moment-revolution
Version:
moment-revolution is a moment plugin to display a date in the French Republican Calendar format.
50 lines (33 loc) • 1.15 kB
Markdown
`moment-revolution` is a [moment](http://momentjs.com) plugin to display a date in the [French Republican Calendar](http://en.wikipedia.org/wiki/French_Republican_Calendar) format.
```js
moment(new Date(1988, 2, 29).revolution().format(); //Nonidi 9 Germinal 196
```
`moment-revolution` is designed to work both using [node](http://nodejs.org) or in the browser.
```html
<script src="moment.js"></script>
<script src="moment-revolution.js"></script>
<script>
...
</script>
```
`moment-revolution`requires moment, but does not include it in its own dependencies, so you have to add it to your `package.json`file. However, you do not have to require it.
`npm install moment-revolution`
```js
var moment = require('moment-revolution');
...
```
```js
var moment = require('moment-revolution');
var start = moment(new Date(1792, 8, 22));
var rev = start.revolution().format();
console.log(rev); // Primidi 1 Vendémiaire 1
```
This work is dedicated to Maximilien Marie Isidore de Robespierre.
This program is in the public domain.