summaryrefslogtreecommitdiff
path: root/ext/calendar
diff options
context:
space:
mode:
authorTal Peer <tal@php.net>2002-11-27 15:52:25 +0000
committerTal Peer <tal@php.net>2002-11-27 15:52:25 +0000
commit8aac1ce2eebcc7365518c25186696de3c4268605 (patch)
tree5660e668d428639393c54d7f81be82a1cb52ef2e /ext/calendar
parente195b10ede547f453e06b0c80b195768b2dabbf8 (diff)
downloadphp-git-8aac1ce2eebcc7365518c25186696de3c4268605.tar.gz
Added an additional (optional) argument to jdtojewish() to keep BC
with 4.3 (and let users getdates in Hebrew without further formatting)
Diffstat (limited to 'ext/calendar')
-rw-r--r--ext/calendar/calendar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index abab7225d8..14639b4c69 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -456,20 +456,21 @@ static char *heb_number_to_chars(int n, int fl)
}
/* }}} */
-/* {{{ proto string jdtojewish(int juliandaycount [, int fl])
+/* {{{ proto string jdtojewish(int juliandaycount [, bool hebrew [, int fl]])
Converts a julian day count to a jewish calendar date */
PHP_FUNCTION(jdtojewish)
{
long julday, fl = 0;
+ zend_bool heb = 0;
int year, month, day;
char date[10], hebdate[25];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &julday, &fl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) {
RETURN_FALSE;
}
SdnToJewish(julday, &year, &month, &day);
- if (!fl) {
+ if (!heb) {
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
} else {