New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

repubdate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repubdate

Conversion and formatting of dates to the French Republican Calendar.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

repubdate

A package to allow Javscript Date objects to report the date in the style of the French Republican Calendar. The calendar was active for only twelve years, from 1793-1805, and it is unclear how it was meant to be extended to the current day. We use the Romme System to calculate the date for years outside of the bounds of the extant use of the calendar.

Installation

Install using npm:

$ npm install repubdate

Usage

repubdate creates a method, toRevolutionaryString, in the standard javascript Date object.

require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString());
//outputs "18 Brumaire, an VIII

toRevolutionaryString can take an optional mode parameter, for other formats.

short uses short names for the months.

require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("short"));
//outputs "18 Bru, VIII"

verbose uses the full name, includes the name of the day within the Décade, as well as the item, animal, or plant that is to be celebrated on that day.

require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("verbose"));
//outputs "Octidi 18 Brumaire, année de la République VIII, le jour du Dentelaire"

english is the verbose string, but in English rather than French.

require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("english"));
//outputs "Octidi 18 Brumaire, year of the Republic VIII, the day of the Leadworts"

numeric is a short version in DD/MM/YY format.

require('repubdate');
var napoleoncoup = new Date("11-9-1799");
console.log(napoleoncoup.toRevolutionaryString("numeric"));
//outputs "18/2/8"

Keywords

FAQs

Package last updated on 09 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc