romme-calendar: add wrapper function to get formated string from jd

This commit is contained in:
Kazhnuz 2018-11-09 11:15:01 +01:00
parent 7c9b78d749
commit 29e003fb98
2 changed files with 28 additions and 0 deletions

View file

@ -64,6 +64,9 @@ $testJulianday = gregoriantojd($testMois, $testJour, $testAnnee);
<strong>gregoriantoromme_getFormattedString :</strong> <?php echo gregoriantoromme_getFormattedString($testMois, $testJour, $testAnnee, false);?><br /> <strong>gregoriantoromme_getFormattedString :</strong> <?php echo gregoriantoromme_getFormattedString($testMois, $testJour, $testAnnee, false);?><br />
<strong>gregoriantoromme_getFormattedStringComplete :</strong> <?php echo gregoriantoromme_getFormattedStringComplete($testMois, $testJour, $testAnnee);?><br /> <strong>gregoriantoromme_getFormattedStringComplete :</strong> <?php echo gregoriantoromme_getFormattedStringComplete($testMois, $testJour, $testAnnee);?><br />
<strong>jdtoromme_getFormattedString :</strong> <?php echo jdtoromme_getFormattedString($testJulianday, false);?><br />
<strong>jdtoromme_getFormattedStringComplete :</strong> <?php echo jdtoromme_getFormattedStringComplete($testJulianday);?><br />
</p> </p>
</body> </body>
</html> </html>

View file

@ -408,4 +408,29 @@ function gregoriantoromme_getFormattedStringComplete($m,$d,$y) {
// return the convertion of the romme date string to a formatted string // return the convertion of the romme date string to a formatted string
return romme_getFormattedStringComplete($romme_date_string); return romme_getFormattedStringComplete($romme_date_string);
} }
/* 4.3. Getting them from the julian day count
*/
function jdtoromme_getFormattedString($juliandaycount, $showDecadeDayName) {
// Convert a gregorian date to a formatted romme date
// Start by getting the romme date string from the gregorian date
$romme_date_string = jdtoromme($juliandaycount);
// return the convertion of the romme date string to a formatted string
return romme_getFormattedString($romme_date_string, $showDecadeDayName);
}
function jdtoromme_getFormattedStringComplete($juliandaycount) {
// Convert a gregorian date to a complete romme formatted string
// Start by getting the romme date string from the gregorian date
$romme_date_string = jdtoromme($juliandaycount);
// return the convertion of the romme date string to a formatted string
return romme_getFormattedStringComplete($romme_date_string);
}
?> ?>