diff --git a/exemple.php b/exemple.php index f87cbee..51ec4b6 100644 --- a/exemple.php +++ b/exemple.php @@ -56,8 +56,11 @@ $testJulianday = gregoriantojd($testMois, $testJour, $testAnnee); romme_getComplementaryDayName :

-

Test des différentes fonctions

+

Getting an automated string

+ romme_completeString :
+ romme_simplerString :
+ gregorian2FrenchDateString :
gregorian2FrenchDateStringShort :
diff --git a/romme-calendar.php b/romme-calendar.php index 83dc05d..4440f1a 100644 --- a/romme-calendar.php +++ b/romme-calendar.php @@ -348,6 +348,46 @@ function romme_getComplementaryDayName($romme_date_string) { These functions help the user to get a more beautifull romme string, usable directly in their pages. */ + +/* 4.1. Converting the romme string to a better string + + */ + +function romme_completeString($romme_date_string) { + // Convert a romme date string to a complete romme date string + + // Start by getting the romme array + $dateArray = romme_getArray($romme_date_string); + + // Get the month and day names + $dayMonthString = repcal_getDayMonthNames($dateArray[0], $dateArray[1], true); + + $saintString = repcal_getComplementaryDayName($dateArray[0], $dateArray[1]); + + // Create the string for the year + $yearString = "an " . $dateArray[2]; + + return $dayMonthString . ", " . $yearString . "
" . $saintString . ""; +} + +function romme_simplerString($romme_date_string) { + // Convert a romme date string to a shorter romme date string + + // Start by getting the romme array + $dateArray = romme_getArray($romme_date_string); + + // Get the month and day names + $dayMonthString = repcal_getDayMonthNames($dateArray[0], $dateArray[1], false); + + // Create the string for the year + $yearString = "an " . $dateArray[2]; + + return $dayMonthString . ", " . $yearString; +} + +/* 4.2. Getting it from the gregorian date + + */ function gregoriantoromme_completeString($m,$d,$y) { // Convert a gregorian date to a complete romme date string