summaryrefslogtreecommitdiff
path: root/ext/intl/calendar/calendar_methods.cpp
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-07-22 03:54:03 +0200
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-07-22 04:22:23 +0200
commit2f0775b999e7859275c614a3d2d8edd1506e0d68 (patch)
tree95b8682fb7fbf8229f3ce17064d14a7842efd812 /ext/intl/calendar/calendar_methods.cpp
parent46629e35ffadae77114088c59faf301328159d83 (diff)
downloadphp-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/calendar/calendar_methods.cpp')
-rw-r--r--ext/intl/calendar/calendar_methods.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 8562a2d69e..f59edaa25e 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -23,7 +23,10 @@
#include <unicode/locid.h>
#include <unicode/calendar.h>
#include <unicode/ustring.h>
+
#include "../intl_convertcpp.h"
+#include "../common/common_date.h"
+
extern "C" {
#define USE_TIMEZONE_POINTER 1
#include "../timezone/timezone_class.h"