Skip to content

Files

Latest commit

 

History

History
49 lines (33 loc) · 1.12 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.12 KB

moment-revolution

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

Installation

moment-revolution is designed to work both using node or in the browser.

In the browser

<script src="moment.js"></script>
<script src="moment-revolution.js"></script>
<script>
  ...
</script>

With node

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');
...

Usage

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

Dedication

This work is dedicated to Maximilien Marie Isidore de Robespierre.

License

This program is in the public domain.