Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/caarmen/french-revolutionary-calendar


https://github.com/caarmen/french-revolutionary-calendar

lib

Last synced: 11 days ago
JSON representation

Awesome Lists containing this project

README

        

French Revolutionary Calendar Library
=====================================

Library providing conversion between Gregorian calendar dates
and French Revolutionary calendar dates.

Also converts 24-hour time to decimal time.

Reference: http://en.wikipedia.org/wiki/French_Republican_Calendar

Library
-------
To use this in your project:

Maven:
```

ca.rmen
lib-french-revolutionary-calendar
1.8.2
pom

```

Gradle:
```
compile 'ca.rmen:lib-french-revolutionary-calendar:1.8.2'

```

Usage:
```java
FrenchRevolutionaryCalendar frc =
new FrenchRevolutionaryCalendar(
Locale.getDefault(),
FrenchRevolutionaryCalendar.CalculationMethod.ROMME):

FrenchRevolutionaryCalendarDate frenchDate =
frc.getDate((GregorianCalendar) Calendar.getInstance());

String text = "Today is " + frenchDate.getWeekdayName()
+ ", " + frenchDate.dayOfMonth
+ " " + frenchDate.getMonthName() + " " + frenchDate.year;
```

Command-line program
--------------------
A command-line program is available.

Build it with: `mvn clean package`

Run it with `java -jar ./cli/target/french-revolutionary-calendar-cli-1.8.2.jar`

With no arguments, it will print out a usage text.

Examples:

Display the current time in the French Revolutionary Calendar:
```shell
$java -jar ./cli/target/french-revolutionary-calendar-cli-1.8.2.jar now
Quartidi, 04-Thermidor-225, 8:70:99, The plant:Ryegrass
```
Display an arbitrary date in the French Revolutionary Calendar:
```
$ java -jar ./cli/target/french-revolutionary-calendar-cli-1.8.2.jar g2f 1998-06-10
Parsing using format yyyy-MM-dd
Duodi, 22-Prairial-206, 0:00:00, The plant:Camomile
```