$('#date').on('change', function(){
var date = moment($(this).val(), 'DD/MM/YYYY');
var revDate = moment(date).revolution().format();
$('#revdate').html(revDate);
});
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-revolutionrequires moment, but does not include it in its own dependencies, so you have to add it to your
package.jsonfile. 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 program is in the public domain.