npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

floreal

v1.1.1

Published

Date formatting for the French Revolutionary calendar

Readme

floreal

Installation

Using git:

$ git clone https://github.com/seeschloss/floreal.git

Using npm:

$ npm install floreal

Usage

new floreal.Date(timespec)

Uses the native JavaScript Date object to parse timespec and takes any correctly formatted date. An undefined timespec means today.

var Floreal = require('floreal').Date;
var coup = new Floreal("1799-11-09");
console.log('%s', coup);

will output:

18 brumaire, an VIII

floreal.Date.toFullDateString()

Returns the full date in long form as "[day number] [month name], an [year in roman numerals]"

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-10-11")).toFullDateString());

will output:

18 brumaire, an VIII

floreal.Date.toShortDateString()

Returns the full date in short form as "[day number]-[month number]-[year in roman numerals]"

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-10-11")).toShortDateString());

will output:

18-02-VIII

floreal.Date.setYear(year)

Sets Republican year for the date in roman numerals

floreal.Date.setYearDecimal(year)

Sets Republican year for the date in arabic numerals

floreal.Date.setMonth(month)

Sets Republican month for the date. Month 1 is vendémiaire, both 0 and 13 represent complementary days.

floreal.Date.setDay(day)

Sets Republican day for the date, first day of the month is 1.

floreal.Date.setDate(year, month, day)

Sets the full Republican date.

var Floreal = require('floreal').Date;
var date = new Floreal();
date.setDate(8, 2, 18);
console.log('%s', date.toFullDateString());

will output:

18 brumaire, an VIII

floreal.Date.setMonth(month)

floreal.Date.setDay(day)

floreal.Date.year()

floreal.Date.yearDecimal()

Displays year of the Republic as roman numerals or as a decimal number

var Floreal = require('floreal').Date;
var coup = new Floreal("1799-11-09");
console.log('%s', coup.year());
console.log('%s', coup.yearDecimal());

will output:

VIII
8

floreal.Date.isYearSextile()

Returns true if year is sextile, using actual sextile years for years I to XVI, and Romme system for subsequent years.

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).isYearSextile());
console.log('%s', (new Floreal("1803-08-18")).isYearSextile());

will output:

false
true

floreal.Date.firstDayOfYear()

Returns the first day of the Republican year as a JavaScript Date object.

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).firstDayOfYear().toDateString());
console.log('%s', (new Floreal("1803-08-18")).firstDayOfYear().toDateString());

will output:

Mon Sep 23 1799
Thu Sep 23 1802

floreal.Date.dayOfYear()

Returns the day number within the year (from 1 to 365, or 366 for sextile years).

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).dayOfYear());

will output:

48

floreal.Date.month()

Returns the month number within the year. Complementary days are technically not part of any month, but for practical purposes are considered part of the 13th month.

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).month());

will output:

2

floreal.Date.isComplementaryDay()

Whether the day is a complementary day—the five or six days at the end of the year which are not part of any month.

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1800-09-20")).isComplementaryDay());

will output:

true

floreal.Date.monthName()

Returns the (French) name of the month, in all lower case, or an empty string for complementary days.

var Floreal = require('floreal').Date;
console.log('"%s"', (new Floreal("1799-11-09")).monthName());
console.log('"%s"', (new Floreal("1800-09-20")).monthName());

will output:

"brumaire"
""

floreal.Date.dayOfMonth()

floreal.Date.day()

Returns the day number within its month, from 1 to 30 (1 to 6 for complementary days).

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).dayOfMonth());
console.log('%s', (new Floreal("1800-09-20")).dayOfMonth());

will output:

18
3

floreal.Date.dayOfDecade()

floreal.Date.dayOfWeek()

Returns the day number within its decade, from 1 to 10 (1 to 6 for complementary days).

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).dayOfDecade());
console.log('%s', (new Floreal("1800-09-20")).dayOfDecade());

will output:

8
3

floreal.Date.decade()

Returns the decade number within the month, from 1 to 3 (complementary days are reported as belonging to first decade).

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).decade());
console.log('%s', (new Floreal("1800-09-20")).decade());

will output:

2
1

floreal.Date.dayName()

Returns the name of the day (primidi, duodi... equivalent to monday, tuesday...). Complementary days have a different naming scheme and are named "jour de la vertu", "jour du génie", etc.

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-11-09")).dayName());

will output:

octidi

floreal.Date.dayTitle()

Returns the French name of the object associated with the day (like saints on Christian calendars).

var Floreal = require('floreal').Date;
console.log('%s', (new Floreal("1799-10-11")).dayTitle());

will output:

tournesol