# repubdate

> Conversion and formatting of dates to the French Republican Calendar.

Latest version **1.0.5** (published 2025-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install repubdate
pnpm add repubdate
yarn add repubdate
bun add repubdate
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2025-12-09 |
| First published | 2017-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 34.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Michael Correll |
| Maintainers | mcorrell |
| Keywords | date, date-formatting, liberty, equality, fraternity |

## Links

- npm: https://www.npmjs.com/package/repubdate
- Repository: https://github.com/mcorrell/repubdate
- Homepage: https://github.com/mcorrell/repubdate#readme
- Issues: https://github.com/mcorrell/repubdate/issues
- npm.io page: https://npm.io/package/repubdate

## Dependencies (1)

- [d3-time](https://npm.io/package/d3-time.md) ^1.0.7

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2025-12-09
- 1.0.4 — 2019-01-09
- 1.0.2 — 2017-07-21
- 1.0.1 — 2017-07-21
- 1.0.0 — 2017-07-21

## README

# repubdate

A package to allow Javscript Date objects to report the date in the style of the [French Republican Calendar](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/French_Republican_Calendar#Converting_from_the_Gregorian_Calendar) 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 ##

### `toRevolutionaryString`

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

```javascript
import "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.

```javascript
import "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.

```javascript
import "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.

```javascript
import "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.

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

### `toRevolutionaryObject`

repubdate creates a `toRevolutionaryObject` method for formatting your own Republican dates. The object's values are listed here:

| Property | Type | Description | Example |
| :--- | :--- | :--- | :--- |
| **`month`** | `Object` | Contains information about the month. | `{...}` |
| `month.name` | `String` | The full name of the month in French. | `'Brumaire'` |
| `month.sname` | `String` | An abbreviated name for the month. | `'Bru'` |
| `month.ename` | `String` | The English translation of the month name. | `'Mist'` |
| `month.number` | `Number` | The numerical value of the month. | `2` |
| **`day`** | `Object` | Contains information about the day. | `{...}` |
| `day.name` | `String` | The French name associated with the day. | `'Dentelaire'` |
| `day.ename` | `String` | The English translation of the day name. | `'Leadworts'` |
| `day.dname` | `String` | The name of the day within the decimal week (décade). | `'Octidi'` |
| `day.number` | `Number` | The day of the month. | `18` |
| **`year`** | `Object` | Contains information about the year. | `{...}` |
| `year.number` | `Number` | The numeric representation of the year. | `8` |
| `year.roman` | `String` | The Roman numeral of the year. | `'VIII'` |

---
_Source: https://npm.io/package/repubdate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
