@CalendarType(value="frenchrev") public final class FrenchRepublicanCalendar extends Calendrical<FrenchRepublicanCalendar.Unit,FrenchRepublicanCalendar>
Represents the calendar used in French Revolution between 1792 and 1805.
Its design is radically different from standard year-month-day-calendars like the gregorian one. The year started at autumnal equinox at the longitude of Paris observatory and was divided into 12 months with the constant length of 30 days. In order to complete the revolution of the earth around the sun, 5 or 6 complementary days were added after the last month. These complementary days are not part of any month and were sometimes also called "Sansculottides". The sixth complementary day only happened in leap years depending on which day the autumnal equinox of next year started, usually every fourth year.
Napoléon abolished the calendar with begin of gregorian year 1806. Interestingly, the Paris Commune of 1871 reintroduced it for 18 days until its militarian destruction.
This calendar had originally no seven-day-week. Instead the months were divided each into three decades of 10 days, and the 10th day was considered as day of rest - like Sunday in the gregorian calendar. However, Time4J makes both the decade design and the standard seven-day-week available, last one mainly for comparison purposes and especially after April 1802 when the calendar abandoned the original decade system. More calendar details see also Wikipedia.
Following elements which are declared as constants are registered by this class:
DAY_OF_DECADEDAY_OF_WEEKDAY_OF_MONTHDAY_OF_YEARDECADE_OF_MONTHMONTH_OF_YEARSANSCULOTTIDESYEAR_OF_ERAERAFurthermore, all elements defined in EpochDays are supported.
Formatting and parsing: When using format patterns the
dynamic pattern type
is strongly recommended instead of CLDR-like pattern types because this calendar
is structurally different from month-based calendars. Following symbol-element
table holds:
| element | symbol | type |
|---|---|---|
| ERA | G | text |
| YEAR_OF_ERA | y/Y | number |
| MONTH_OF_YEAR | m/M | number/text |
| SANSCULOTTIDES | s/S | text |
| DAY_OF_MONTH | d/D | number |
| DAY_OF_DECADE | c/C | text |
| DAY_OF_WEEK | E | text |
Note: The standalone form of some enums like the republican month can be printed in a capitalized way
if the formatter is first constructed on builder level by using a sectional attribute for the output context.
Alternatively, users can simply modify the formatter by calling
f.with(Attributes.OUTPUT_CONTEXT, OutputContext.STANDALONE).
Furthermore: The abbreviated form of the republican month is usually numeric with two arabic digits. For more control about the numeric representation, the builder offers extra fine-tuned methods.
It is strongly recommended to use the or-operator "|" in format patterns because not every date of this calendar has a month. Example:
ChronoFormatter<FrenchRepublicanCalendar> f =
ChronoFormatter.ofPattern(
"[D. MMMM|SSSS]', an 'Y",
PatternType.DYNAMIC,
Locale.FRENCH,
FrenchRepublicanCalendar.axis());
FrenchRepublicanCalendar cal = PlainDate.of(2018, 9, 23).transform(FrenchRepublicanCalendar.axis());
System.out.println(f.format(cal)); // output => 1. vendémiaire, an CCXXVII
cal = cal.minus(CalendarDays.ONE);
System.out.println(f.format(cal)); // output => jour de la révolution, an CCXXVI
FrenchRepublicanEra,
FrenchRepublicanMonth,
Sansculottides,
DayOfDecade,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
FrenchRepublicanCalendar.Date
Static view of calendar date taking into account possibly different calendar algorithms.
|
static class |
FrenchRepublicanCalendar.Unit
Defines come calendar units for the French revolutionary calendar.
|
| Modifier and Type | Field and Description |
|---|---|
static ChronoElement<DayOfDecade> |
DAY_OF_DECADE
Represents the days of decade which consists of ten days.
|
static StdCalendarElement<Integer,FrenchRepublicanCalendar> |
DAY_OF_MONTH
Represents the day of month if available.
|
static StdCalendarElement<Weekday,FrenchRepublicanCalendar> |
DAY_OF_WEEK
Represents the day of week where the week is seven days long.
|
static StdCalendarElement<Integer,FrenchRepublicanCalendar> |
DAY_OF_YEAR
Represents the day of year.
|
static StdCalendarElement<Integer,FrenchRepublicanCalendar> |
DECADE_OF_MONTH
Yields the decade of republican month if available.
|
static ChronoElement<FrenchRepublicanEra> |
ERA
Represents the Republican era of the French revolution.
|
static StdCalendarElement<FrenchRepublicanMonth,FrenchRepublicanCalendar> |
MONTH_OF_YEAR
Represents the month (Vendémiaire - Fructidor) if available.
|
static ChronoElement<Sansculottides> |
SANSCULOTTIDES
Represents the complementary days of the French revolutionary calendar.
|
static StdCalendarElement<Integer,FrenchRepublicanCalendar> |
YEAR_OF_ERA
Represents the republican year since 1792-09-22 (in range 1-1202).
|
| Modifier and Type | Method and Description |
|---|---|
GeneralTimestamp<FrenchRepublicanCalendar> |
at(PlainTime time)
Creates a new local timestamp with this date and given wall time.
|
GeneralTimestamp<FrenchRepublicanCalendar> |
atTime(int hour,
int minute)
Is equivalent to
at(PlainTime.of(hour, minute)). |
static TimeAxis<FrenchRepublicanCalendar.Unit,FrenchRepublicanCalendar> |
axis()
Returns the associated time axis.
|
boolean |
contains(ChronoElement<?> element)
Queries if the value for given chronological element can be
accessed via
get(element). |
boolean |
equals(Object obj)
Based on the epoch day number and the calendar system.
|
FrenchRepublicanCalendar.Date |
getDate(FrenchRepublicanAlgorithm algorithm)
Obtains an alternative date view specific for given algorithm.
|
DayOfDecade |
getDayOfDecade()
Yields the day of decade if available (ten-day-week).
|
int |
getDayOfMonth()
Yields the day of month if available.
|
Weekday |
getDayOfWeek()
Determines the day of standard-week (with seven days).
|
int |
getDayOfYear()
Yields the day of year.
|
int |
getDecade()
Yields the decade of current republican month if available.
|
FrenchRepublicanEra |
getEra()
Yields the republican era.
|
FrenchRepublicanMonth |
getMonth()
Yields the republican month if available.
|
Sansculottides |
getSansculottides()
Yields the complementary day if available.
|
int |
getYear()
Yields the republican year.
|
int |
hashCode()
Based on the epoch day number.
|
boolean |
hasMonth()
Does this date contain a month?
|
boolean |
hasSansculottides()
Is this date a complementary day?
|
boolean |
isLeapYear()
Is the year of this date a leap year?
|
static boolean |
isLeapYear(int year)
Is given republican year a leap year?
|
<V> boolean |
isValid(ChronoElement<V> element,
V value)
Tests if the value for given chronological value is invalid.
|
static boolean |
isValid(int year,
int month,
int dayOfMonth)
Queries if given parameter values form a well defined calendar date.
|
static FrenchRepublicanCalendar |
nowInSystemTime()
Obtains the current calendar date in system time.
|
static FrenchRepublicanCalendar |
of(int year,
FrenchRepublicanMonth month,
int dayOfMonth)
Creates a new instance of a French republican date.
|
static FrenchRepublicanCalendar |
of(int year,
int month,
int dayOfMonth)
Creates a new instance of a French republican date.
|
static FrenchRepublicanCalendar |
of(int year,
Sansculottides sansculottides)
Creates a new instance of a French republican date as complementary day.
|
String |
toString()
Provides a complete textual representation of the state of
this time point.
|
FrenchRepublicanCalendar |
withEndOfFranciade()
Obtains the next leap day when the franciade ends.
|
compareTo, getDaysSinceEpochUTC, isAfter, isBefore, isSimultaneous, minus, plusmax, min, minus, minus, plus, plus, until, untilget, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, matches, with, with, with, withfrom, from, from, transform, transform, transform, transform, transform, transformisAfterAll, isAfterOrEqual, isBeforeAll, isBeforeOrEqual@FormattableElement(format="G", dynamic=true) public static final ChronoElement<FrenchRepublicanEra> ERA
Represents the Republican era of the French revolution.
@FormattableElement(format="Y", alt="y", dynamic=true) public static final StdCalendarElement<Integer,FrenchRepublicanCalendar> YEAR_OF_ERA
Represents the republican year since 1792-09-22 (in range 1-1202).
The year is printed as roman number when using a pattern and the French language.
@FormattableElement(format="S", alt="s", dynamic=true) public static final ChronoElement<Sansculottides> SANSCULOTTIDES
Represents the complementary days of the French revolutionary calendar.
Warning: A French republican date does usually not have a complementary day
so any access via get(SANSCULOTTIDES) will throw an exception unless
users make sure that the day in question is indeed a complementary day.
However, it is always possible to query the date for the minimum or maximum complementary day or to set the date to a complementary day even if the actual date is not a complementary day.
hasSansculottides(),
hasMonth()@FormattableElement(format="M", alt="m", dynamic=true) public static final StdCalendarElement<FrenchRepublicanMonth,FrenchRepublicanCalendar> MONTH_OF_YEAR
Represents the month (Vendémiaire - Fructidor) if available.
Warning: A French republican date does not always have a month. If the
date is a complementary day (Sansculottides) then any access via get(MONTH_OF_YEAR)
to this element will be rejected by raising an exception. Users have first to make sure
that the date is not such a complementary day.
However, it is always possible to query the date for the minimum or maximum month or to set the date to a month-related day even if the actual date is a complementary day.
hasSansculottides(),
hasMonth()public static final StdCalendarElement<Integer,FrenchRepublicanCalendar> DECADE_OF_MONTH
Yields the decade of republican month if available.
Warning: A French republican date does not always have a decade. If the date is a complementary day (Sansculottides) then any access to this element will be rejected by raising an exception. Users have first to make sure that the date is not such a complementary day.
hasSansculottides(),
hasMonth()@FormattableElement(format="C", alt="c", dynamic=true) public static final ChronoElement<DayOfDecade> DAY_OF_DECADE
Represents the days of decade which consists of ten days.
Warning: A French republican date does not always have a day of decade. If the date is a complementary day (Sansculottides) then any access to this element will be rejected by raising an exception. Users have first to make sure that the date is not such a complementary day.
hasSansculottides(),
hasMonth()@FormattableElement(format="D", alt="d", dynamic=true) public static final StdCalendarElement<Integer,FrenchRepublicanCalendar> DAY_OF_MONTH
Represents the day of month if available.
Warning: A French republican date does not always have a month. If the date is a complementary day (Sansculottides) then any access to this element will be rejected by raising an exception. Users have first to make sure that the date is not such a complementary day.
hasSansculottides(),
hasMonth()public static final StdCalendarElement<Integer,FrenchRepublicanCalendar> DAY_OF_YEAR
Represents the day of year.
@FormattableElement(format="E", dynamic=true) public static final StdCalendarElement<Weekday,FrenchRepublicanCalendar> DAY_OF_WEEK
Represents the day of week where the week is seven days long.
If the day-of-week is set to a new value then Time4J handles the calendar week as starting on Sunday.
DAY_OF_DECADEpublic static FrenchRepublicanCalendar of(int year, FrenchRepublicanMonth month, int dayOfMonth)
Creates a new instance of a French republican date.
year - republican year in range 1-1202month - republican month as enumdayOfMonth - day of month in range 1-30FrenchRepublicanCalendarIllegalArgumentException - in case of any inconsistenciespublic static FrenchRepublicanCalendar of(int year, int month, int dayOfMonth)
Creates a new instance of a French republican date.
year - republican year in range 1-1202month - republican month in range 1-12dayOfMonth - day of month in range 1-30FrenchRepublicanCalendarIllegalArgumentException - in case of any inconsistenciespublic static FrenchRepublicanCalendar of(int year, Sansculottides sansculottides)
Creates a new instance of a French republican date as complementary day.
year - republican year in range 1-1202sansculottides - the complementary dayFrenchRepublicanCalendarIllegalArgumentException - in case of any inconsistenciespublic static FrenchRepublicanCalendar nowInSystemTime()
Obtains the current calendar date in system time.
Convenient short-cut for: SystemClock.inLocalView().now(FrenchRepublicanCalendar.axis()).
SystemClock.inLocalView(),
ZonalClock.now(Chronology)public FrenchRepublicanEra getEra()
Yields the republican era.
FrenchRepublicanEra.REPUBLICANpublic int getYear()
Yields the republican year.
public FrenchRepublicanMonth getMonth()
Yields the republican month if available.
ChronoException - if this date is a complementary dayMONTH_OF_YEAR,
hasSansculottides(),
hasMonth()public int getDecade()
Yields the decade of current republican month if available.
ChronoException - if this date is a complementary dayDECADE_OF_MONTH,
hasSansculottides(),
hasMonth()public int getDayOfMonth()
Yields the day of month if available.
ChronoException - if this date is a complementary dayDAY_OF_MONTH,
hasSansculottides(),
hasMonth()public DayOfDecade getDayOfDecade()
Yields the day of decade if available (ten-day-week).
ChronoException - if this date is a complementary dayDAY_OF_DECADE,
hasSansculottides(),
hasMonth()public Weekday getDayOfWeek()
Determines the day of standard-week (with seven days).
public int getDayOfYear()
Yields the day of year.
public Sansculottides getSansculottides()
Yields the complementary day if available.
ChronoException - if this date is not a complementary dayhasSansculottides(),
hasMonth()public boolean hasSansculottides()
Is this date a complementary day?
A date in the French revolutionary calendar has either a month or is a complementary day.
hasMonth(),
MONTH_OF_YEAR,
DAY_OF_MONTH,
DECADE_OF_MONTH,
DAY_OF_DECADE,
SANSCULOTTIDESpublic boolean hasMonth()
Does this date contain a month?
A date in the French revolutionary calendar has either a month or is a complementary day.
hasSansculottides(),
MONTH_OF_YEAR,
DAY_OF_MONTH,
DECADE_OF_MONTH,
DAY_OF_DECADE,
SANSCULOTTIDESpublic boolean isLeapYear()
Is the year of this date a leap year?
public static boolean isLeapYear(int year)
Is given republican year a leap year?
year - republican year to be checked (in range 1-1202)public static boolean isValid(int year,
int month,
int dayOfMonth)
Queries if given parameter values form a well defined calendar date.
year - the year of era to be checkedmonth - the month to be checkeddayOfMonth - the day of month to be checkedtrue if valid else falseof(int, int, int)public FrenchRepublicanCalendar.Date getDate(FrenchRepublicanAlgorithm algorithm)
Obtains an alternative date view specific for given algorithm.
algorithm - calendar computationIllegalArgumentException - in case of date overflowpublic GeneralTimestamp<FrenchRepublicanCalendar> at(PlainTime time)
Creates a new local timestamp with this date and given wall time.
If the time T24:00 is used
then the resulting timestamp will automatically be normalized such
that the timestamp will contain the following day instead.
time - wall timepublic GeneralTimestamp<FrenchRepublicanCalendar> atTime(int hour, int minute)
Is equivalent to at(PlainTime.of(hour, minute)).
hour - hour of day in range (0-24)minute - minute of hour in range (0-59)IllegalArgumentException - if any argument is out of rangepublic FrenchRepublicanCalendar withEndOfFranciade()
Obtains the next leap day when the franciade ends.
Sansculottides.LEAP_DAYpublic boolean equals(Object obj)
CalendricalBased on the epoch day number and the calendar system.
In other words: Two date object are equal if they have the same temporal position on the local timeline and have the same calendrical type. Subclasses which define further state attributes must override this method.
If an only temporal comparison is required then the method
Calendrical.isSimultaneous(CalendarDate) is to be used.
equals in class Calendrical<FrenchRepublicanCalendar.Unit,FrenchRepublicanCalendar>Chronology.getChronoType()public int hashCode()
CalendricalBased on the epoch day number.
hashCode in class Calendrical<FrenchRepublicanCalendar.Unit,FrenchRepublicanCalendar>public String toString()
TimePointProvides a complete textual representation of the state of this time point.
The textual description often follows the conventions of ISO-8601. Usually the description starts with the chronological informations which are coarse-grained and ends with those ones which are fine-grained (for example the ISO-notation YYYY-MM-DD).
toString in class TimePoint<FrenchRepublicanCalendar.Unit,FrenchRepublicanCalendar>public boolean contains(ChronoElement<?> element)
ChronoDisplayQueries if the value for given chronological element can be
accessed via get(element).
If the argument is missing then this method will yield false.
Note: Elements which are not registered but define a suitable rule
are also accessible.
contains in interface ChronoDisplaycontains in class ChronoEntity<FrenchRepublicanCalendar>element - chronological element to be asked (optional)true if the element is registered or there is an element rule for evaluating the value
else falseChronoDisplay.get(ChronoElement)public <V> boolean isValid(ChronoElement<V> element, V value)
ChronoEntityTests if the value for given chronological value is invalid.
Notes: This method tests if given value to be in question can
be set via the expression with(element, value). A numerical
overflow situation (causing an ArithmeticException) will
usually not be checked.
isValid in class ChronoEntity<FrenchRepublicanCalendar>V - generic type of element valueelement - element the given value shall be assigned tovalue - candidate value to be validated (optional)true if the method with() can be called
without exception else falsewith(ChronoElement, V)public static TimeAxis<FrenchRepublicanCalendar.Unit,FrenchRepublicanCalendar> axis()
Returns the associated time axis.
Copyright © 2014–2021. All rights reserved.