diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-07-22 03:54:03 +0200 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-07-22 04:22:23 +0200 |
commit | 2f0775b999e7859275c614a3d2d8edd1506e0d68 (patch) | |
tree | 95b8682fb7fbf8229f3ce17064d14a7842efd812 /ext/intl/msgformat/msgformat_helpers.cpp | |
parent | 46629e35ffadae77114088c59faf301328159d83 (diff) | |
download | php-git-2f0775b999e7859275c614a3d2d8edd1506e0d68.tar.gz |
Added IntlDateFormatter::formatObject(). Refactor
To better support IntlCalendar, added this function:
string IntlDateFormatter::formatObject(IntlCalendar|DateTime $obj [,
array|int|string $format = null [, string $locale = null).
$format is either of the constants IntlDateFormatter::FULL, etc., in
which case this format applies to both the date and the time, an array
in the form array($dateFormat, $timeFormat), or a string with the
SimpleDateFormat pattern.
This uses both the Calendar type and the timezone of the passed object
to configure the formatter (a GregorianCalendar is forced for
DateTime).
Some stuff was moved around and slighlt modified to allow for more code
reuse.
Diffstat (limited to 'ext/intl/msgformat/msgformat_helpers.cpp')
-rwxr-xr-x | ext/intl/msgformat/msgformat_helpers.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c822319078..9ee1cdcfb0 100755 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -43,14 +43,6 @@ extern "C" { #include "../timezone/timezone_class.h" } -#ifndef INFINITY -#define INFINITY (DBL_MAX+DBL_MAX) -#endif - -#ifndef NAN -#define NAN (INFINITY-INFINITY) -#endif - #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48 #define HAS_MESSAGE_PATTERN 1 #endif @@ -549,7 +541,7 @@ retry_kint64: } case Formattable::kDate: { - double dd = intl_zval_to_millis(*elem, &err.code TSRMLS_CC); + double dd = intl_zval_to_millis(*elem, &err, "msgfmt_format" TSRMLS_CC); if (U_FAILURE(err.code)) { char *message, *key_char; int key_len; |