Class CalendarSynchronizer
java.lang.Object
org.episteme.social.history.clock.CalendarSynchronizer
Utility for synchronizing dates across various historical, religious, and political calendars.
Provides conversions between standard ISO-8601 (Gregorian) and systems like Hijri,
French Republican, and Julian.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionconvertGregorian(int year, int month, int day) Converts a Gregorian date to multiple chronological systems.static booleanisJulianLeapYear(int year) Determines if a year is a leap year in the Julian calendar.static intjulianToGregorianOffset(int year) Calculates the offset in days between Julian and Gregorian calendars for a given year.static StringtoFrenchRepublican(LocalDate date) Converts a modern date to the French Republican Calendar (simplified model).
-
Method Details
-
convertGregorian
Converts a Gregorian date to multiple chronological systems.- Parameters:
year- the Gregorian yearmonth- the Gregorian month (1-12)day- the Gregorian day of month- Returns:
- a map of system names to formatted date strings
- Throws:
DateTimeException- if date components are invalid
-
julianToGregorianOffset
public static int julianToGregorianOffset(int year) Calculates the offset in days between Julian and Gregorian calendars for a given year.Formula:
Floor(Y/100) - Floor(Y/400) - 2- Parameters:
year- the year to calculate for- Returns:
- day offset (positive means Gregorian is ahead)
-
isJulianLeapYear
public static boolean isJulianLeapYear(int year) Determines if a year is a leap year in the Julian calendar. In the Julian system, every year divisible by 4 is a leap year.- Parameters:
year- the year to check- Returns:
- true if leap year
-
toFrenchRepublican
Converts a modern date to the French Republican Calendar (simplified model).Uses September 22, 1792 (Autumnal Equinox) as the Epoch (Year I). This implementation uses a fixed 365-day year model.
- Parameters:
date- the date to convert- Returns:
- formatted republican date string
- Throws:
NullPointerException- if date is null
-