moment-revolution
is a moment plugin to display a date in the French Republican Calendar format.
moment(new Date(1988, 2, 29).revolution().format(); //Nonidi 9 Germinal 196
moment-revolution
is designed to work both using node or in the browser.
<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
var moment = require('moment-revolution');
...
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.