romme-calendar: rename and reorder formatting string functions

This commit is contained in:
Kazhnuz 2018-11-09 11:02:32 +01:00
parent a0c9d463e1
commit 0ca678243a
2 changed files with 18 additions and 18 deletions

View file

@ -58,8 +58,8 @@ $testJulianday = gregoriantojd($testMois, $testJour, $testAnnee);
<h2>Getting an automated string</h2> <h2>Getting an automated string</h2>
<p> <p>
<strong>romme_completeString :</strong> <?php echo romme_completeString( jdtoromme( $testJulianday ) );?> <br /> <strong>romme_getFormattedString :</strong> <?php echo romme_getFormattedString( jdtoromme( $testJulianday ), false );?> <br />
<strong>romme_simplerString :</strong> <?php echo romme_simplerString( jdtoromme( $testJulianday ) );?> <br /> <strong>romme_getFormattedStringComplete :</strong> <?php echo romme_getFormattedStringComplete( jdtoromme( $testJulianday ) );?> <br />
<strong>gregorian2FrenchDateString :</strong> <?php echo gregoriantoromme_completeString($testMois, $testJour, $testAnnee);?><br /> <strong>gregorian2FrenchDateString :</strong> <?php echo gregoriantoromme_completeString($testMois, $testJour, $testAnnee);?><br />
<strong>gregorian2FrenchDateStringShort :</strong> <?php echo gregoriantoromme_simplerString($testMois, $testJour, $testAnnee);?><br /> <strong>gregorian2FrenchDateStringShort :</strong> <?php echo gregoriantoromme_simplerString($testMois, $testJour, $testAnnee);?><br />

View file

@ -353,7 +353,22 @@ function romme_getComplementaryDayName($romme_date_string) {
*/ */
function romme_completeString($romme_date_string) { function romme_getFormattedString($romme_date_string, $showDecadeDayName) {
// 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], $showDecadeDayName);
// Create the string for the year
$yearString = "an " . $dateArray[2];
return $dayMonthString . ", " . $yearString;
}
function romme_getFormattedStringComplete($romme_date_string) {
// Convert a romme date string to a complete romme date string // Convert a romme date string to a complete romme date string
// Start by getting the romme array // Start by getting the romme array
@ -370,21 +385,6 @@ function romme_completeString($romme_date_string) {
return $dayMonthString . ", " . $yearString . "<br /><em>" . $saintString . "</em>"; return $dayMonthString . ", " . $yearString . "<br /><em>" . $saintString . "</em>";
} }
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 /* 4.2. Getting it from the gregorian date
*/ */