Download the PHP package popy/republican-calendar without Composer
On this page you can find all versions of the php package popy/republican-calendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download popy/republican-calendar
More information about popy/republican-calendar
Files in popy/republican-calendar
Informations about the package republican-calendar
French Republican Calendar
This is a popy/calendar implementation of theFrench Republican/Revolutionary calendar., which is a 12 monthes of 30 days calendar, with 5 (or 6 on leap years) additional days which has been inspired from the Egyptian calendar.
Date convertors are no longer inspired from caarmen's work but her work helped me a lot to wrap my head around all the difficulties of date conversion.
The dates conversion handles timezones and DST, which are keeped as regular hour jumps, at the same dates/hours than with regular dates, which gives constistency in a day.
Other calendars
As said earlier, the revolutionary calendar is based on the egyptian one, so the have a dedicated method that initializes an Egyptian calendar, just using configuration (but this is achievable with only the popy/calendar package). Some egyptian calendar variations may be added aswell :
- Coptic
- Ethiopian
Purpose
It serves as an example/proof of concept, and as a sandbox. Code is tested there and eventually, if it works and is This is an example implementation of popy/calendar interfaces, aswell as a sandbox (who said litter) and improvement lab. Most of popy/calendar tools and interfaces originate from this repository.
Usage
The easiest way to get a proper republican calendar is to use the configurable factory.
Usage is basically the same as any popy/php-calendar implementation, with few additions :
- will output the day individual name
- seperates 2 alternatives, the first is used for regular date, the second alternative, if present, is used for the complementary day.
Calculation Methods
The initial calendar definition had vague rules on where to insert leap days, and it was abandoned before a solution has been decided (or needed). Multiple leap days calculators are available, in addition with calculator provided by popy/calendar :
- RommeOddLeapDay : Wrapps any calculator, but transmit a different year value in order to make sure that the leap years will match the first 20 years leaps.
- RommeWithFixedLeapDay : wrapps any calculator, will transmit a different year during the first 20 years (same reason than above) then will become transparent.
CalendarFactory will defaults on a RommeOddLeapDay/Modern couple.
Format alternatives
popy/republican-calendar brings a special formatter that will use a format alternative, if given, to format the egyptian complementary month, using a | as separator, mirroring the behaviour of the popy/calendar native format parser (which means the same format string can be used to format, then parse the date, and will match both alternatives).
Time formats
The French Republican/Revolutionary calendar initially came with a decimal time format (10h, 100m, 100s) just as the egyption inspiration, replacing the duodecimal format (24h, 60m, 60s), but was quickly abandoned, probably because of the difficuly and cost to replace every clock in the country (because at that time, they didn't have smartwatches able to upgrade their apps. Dark times.)
So, depending on how revolutionnary you feel, you can use one format or another, by injecting the TimeConvertor suiting your needs.
CalendarFactory will default to the actual DuoDecimal representation.
Trivia : The Chinese time system divided the day in 100 equal parts (ke) of 14 minutes 24seconds, which is very close of our quarter hour, and matches perfectly the 10 minutes in the decimal time system. Isn't that interoperability ?