romme-calendar: rework how works formatted string date from gregorian
This commit is contained in:
parent
0ca678243a
commit
e1f66cac33
2 changed files with 18 additions and 28 deletions
|
@ -61,8 +61,8 @@ $testJulianday = gregoriantojd($testMois, $testJour, $testAnnee);
|
||||||
<strong>romme_getFormattedString :</strong> <?php echo romme_getFormattedString( jdtoromme( $testJulianday ), false );?> <br />
|
<strong>romme_getFormattedString :</strong> <?php echo romme_getFormattedString( jdtoromme( $testJulianday ), false );?> <br />
|
||||||
<strong>romme_getFormattedStringComplete :</strong> <?php echo romme_getFormattedStringComplete( 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>gregoriantoromme_getFormattedString :</strong> <?php echo gregoriantoromme_getFormattedString($testMois, $testJour, $testAnnee, false);?><br />
|
||||||
<strong>gregorian2FrenchDateStringShort :</strong> <?php echo gregoriantoromme_simplerString($testMois, $testJour, $testAnnee);?><br />
|
<strong>gregoriantoromme_getFormattedStringComplete :</strong> <?php echo gregoriantoromme_getFormattedStringComplete($testMois, $testJour, $testAnnee);?><br />
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -354,7 +354,7 @@ function romme_getComplementaryDayName($romme_date_string) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function romme_getFormattedString($romme_date_string, $showDecadeDayName) {
|
function romme_getFormattedString($romme_date_string, $showDecadeDayName) {
|
||||||
// Convert a romme date string to a shorter romme date string
|
// Convert a romme date string to a formated romme date
|
||||||
|
|
||||||
// Start by getting the romme array
|
// Start by getting the romme array
|
||||||
$dateArray = romme_getArray($romme_date_string);
|
$dateArray = romme_getArray($romme_date_string);
|
||||||
|
@ -369,7 +369,7 @@ function romme_getFormattedString($romme_date_string, $showDecadeDayName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function romme_getFormattedStringComplete($romme_date_string) {
|
function romme_getFormattedStringComplete($romme_date_string) {
|
||||||
// Convert a romme date string to a complete romme date string
|
// Convert a romme date string to a formated complete romme date
|
||||||
|
|
||||||
// Start by getting the romme array
|
// Start by getting the romme array
|
||||||
$dateArray = romme_getArray($romme_date_string);
|
$dateArray = romme_getArray($romme_date_string);
|
||||||
|
@ -385,37 +385,27 @@ function romme_getFormattedStringComplete($romme_date_string) {
|
||||||
return $dayMonthString . ", " . $yearString . "<br /><em>" . $saintString . "</em>";
|
return $dayMonthString . ", " . $yearString . "<br /><em>" . $saintString . "</em>";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 4.2. Getting it from the gregorian date
|
/* 4.2. Getting them from the gregorian date
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function gregoriantoromme_completeString($m,$d,$y) {
|
function gregoriantoromme_getFormattedString($m,$d,$y, $showDecadeDayName) {
|
||||||
// Convert a gregorian date to a complete romme date string
|
// Convert a gregorian date to a formatted romme date
|
||||||
|
|
||||||
// Start by getting the romme array from the gregorian date
|
// Start by getting the romme date string from the gregorian date
|
||||||
$dateArray = gregoriantoromme_getArray($m,$d,$y);
|
$romme_date_string = gregoriantoromme($m,$d,$y);
|
||||||
|
|
||||||
// Get the month and day names
|
// return the convertion of the romme date string to a formatted string
|
||||||
$dayMonthString = repcal_getDayMonthNames($dateArray[0], $dateArray[1], true);
|
return romme_getFormattedString($romme_date_string, $showDecadeDayName);
|
||||||
|
|
||||||
$saintString = repcal_getComplementaryDayName($dateArray[0],$dateArray[1]);
|
|
||||||
|
|
||||||
// Create the string for the year
|
|
||||||
$yearString = "an " . $dateArray[2];
|
|
||||||
|
|
||||||
return $dayMonthString . ", " . $yearString . "<br /><em>" . $saintString . "</em>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function gregoriantoromme_simplerString($m,$d,$y) {
|
function gregoriantoromme_getFormattedStringComplete($m,$d,$y) {
|
||||||
// Convert a gregorian date to a shorter romme date string
|
// Convert a gregorian date to a complete romme formatted string
|
||||||
$dateArray = gregoriantoromme_getArray($m,$d,$y);
|
|
||||||
|
|
||||||
// Get the month and day names
|
// Start by getting the romme date string from the gregorian date
|
||||||
$dayMonthString = repcal_getEpiphany($dateArray[0], $dateArray[1], false);
|
$romme_date_string = gregoriantoromme($m,$d,$y);
|
||||||
|
|
||||||
// Create the string for the year
|
// return the convertion of the romme date string to a formatted string
|
||||||
$yearString = "an " . $dateArray[2];
|
return romme_getFormattedStringComplete($romme_date_string);
|
||||||
|
|
||||||
return $dayMonthString . ", " . $yearString;
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue