. */ use Fisharebest\ExtCalendar\FrenchCalendar; /** * Class FrenchDate - Definitions for the French Republican calendar */ class FrenchDate extends CalendarDate { /** {@inheritdoc} */ public static $MONTH_ABBREV = array('' => 0, 'VEND' => 1, 'BRUM' => 2, 'FRIM' => 3, 'NIVO' => 4, 'PLUV' => 5, 'VENT' => 6, 'GERM' => 7, 'FLOR' => 8, 'PRAI' => 9, 'MESS' => 10, 'THER' => 11, 'FRUC' => 12, 'COMP' => 13); /** {@inheritdoc} */ public function __construct($date) { $this->calendar = new FrenchCalendar; parent::__construct($date); } /** {@inheritdoc} */ public static function monthNameNominativeCase($month_number, $leap_year) { static $translated_month_names; if ($translated_month_names === null) { $translated_month_names = array( 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Vendémiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Brumaire'), 3 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Frimaire'), 4 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Nivôse'), 5 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Pluviôse'), 6 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Ventôse'), 7 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Germinal'), 8 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Floréal'), 9 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Prairial'), 10 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Messidor'), 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'jours complémentaires'), ); } return $translated_month_names[$month_number]; } /** {@inheritdoc} */ protected function monthNameGenitiveCase($month_number, $leap_year) { static $translated_month_names; if ($translated_month_names === null) { $translated_month_names = array( 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Vendémiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Brumaire'), 3 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Frimaire'), 4 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Nivôse'), 5 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Pluviôse'), 6 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Ventôse'), 7 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Germinal'), 8 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Floréal'), 9 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Prairial'), 10 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Messidor'), 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'jours complémentaires'), ); } return $translated_month_names[$month_number]; } /** {@inheritdoc} */ protected function monthNameLocativeCase($month_number, $leap_year) { static $translated_month_names; if ($translated_month_names === null) { $translated_month_names = array( 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Vendémiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Brumaire'), 3 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Frimaire'), 4 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Nivôse'), 5 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Pluviôse'), 6 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Ventôse'), 7 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Germinal'), 8 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Floréal'), 9 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Prairial'), 10 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Messidor'), 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'jours complémentaires'), ); } return $translated_month_names[$month_number]; } /** {@inheritdoc} */ protected function monthNameInstrumentalCase($month_number, $leap_year) { static $translated_month_names; if ($translated_month_names === null) { $translated_month_names = array( 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Vendémiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Brumaire'), 3 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Frimaire'), 4 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Nivôse'), 5 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Pluviôse'), 6 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Ventôse'), 7 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Germinal'), 8 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Floréal'), 9 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Prairial'), 10 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Messidor'), 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'jours complémentaires'), ); } return $translated_month_names[$month_number]; } /** {@inheritdoc} */ protected function monthNameAbbreviated($month_number, $leap_year) { return self::monthNameNominativeCase($month_number, $leap_year); } /** {@inheritdoc} */ public function dayNames($day_number) { static $translated_day_names; if ($translated_day_names === null) { $translated_day_names = array( 0 => /* I18N: a day in the French republican calendar */ I18N::translate('Primidi'), 1 => /* I18N: a day in the French republican calendar */ I18N::translate('Duodi'), 2 => /* I18N: a day in the French republican calendar */ I18N::translate('Tridi'), 3 => /* I18N: a day in the French republican calendar */ I18N::translate('Quartidi'), 4 => /* I18N: a day in the French republican calendar */ I18N::translate('Quintidi'), 5 => /* I18N: a day in the French republican calendar */ I18N::translate('Sextidi'), 6 => /* I18N: a day in the French republican calendar */ I18N::translate('Septidi'), 7 => /* I18N: a day in the French republican calendar */ I18N::translate('Octidi'), 8 => /* I18N: a day in the French republican calendar */ I18N::translate('Nonidi'), 9 => /* I18N: a day in the French republican calendar */ I18N::translate('Decidi'), ); } return $translated_day_names[$day_number]; } /** {@inheritdoc} */ protected function dayNamesAbbreviated($day_number) { return $this->dayNames($day_number); } /** {@inheritdoc} */ protected function formatLongYear() { return $this->numberToRomanNumerals($this->y); } }