Commit Graph

15 Commits

Author SHA1 Message Date
Gustavo André dos Santos Lopes
06e06f026d Merge branch '5.4'
* 5.4:
  Fix test title and limit it to ICU >= 4.8
  Remove executable bit from files
  Limit test to ICU 49
  Remove executable bit from files
2012-07-30 11:04:48 +02:00
Gustavo André dos Santos Lopes
9762609cec Remove executable bit from files 2012-07-30 10:25:17 +02:00
Gustavo Lopes
ae3a827bf9 Leak caused by wrong and unreachable cleanup 2012-07-23 17:00:52 +02:00
Gustavo André dos Santos Lopes
2f0775b999 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.
2012-07-22 04:22:23 +02:00
Gustavo André dos Santos Lopes
46629e35ff Refactored internal_get_timestamp()
Added bounds checking for 32-bit ints.

Do not fetch array elements that ::parse() generates but that
::format() does not actually care about.y
2012-07-02 00:26:38 +02:00
Gustavo André dos Santos Lopes
2416719fb1 Unified zval -> UDate conversions
Now IntlDateFormatter::format() also accepts IntlCalendar objects.
Code is shared in MessageFormatter and IntlDateFormatter.
2012-07-02 00:24:54 +02:00
Gustavo André dos Santos Lopes
eb346ef0f4 DateFormat plays nice with Calendar, TimeZone
The following changes were made:

* The IntlDateFormatter constructor now accepts the usual values
  for its $timezone argument. This includes timezone identifiers,
  IntlTimeZone objects, DateTimeZone objects and NULL. An empty
  string is not accepted. An invalid time zone is no longer accepted
  (it used to use UTC in this case).
* When NULL is passed to IntlDateFormatter, the time zone specified in
  date.timezone is used instead of the ICU default.
* The IntlDateFormatter $calendar argument now accepts also an
  IntlCalendar. In this case, IntlDateFormatter::getCalendar() will
  return false.
* The time zone passed to the IntlDateFormatter is ignored if it is
  NULL and if the calendar passed is an IntlCalendar object -- in this
  case, the IntlCalendar time zone will be used instead. Otherwise,
  the time zone specified in the $timezone argument is used instead.
* Added IntlDateFormatter::getCalendarObject(), which always returns
  the IntlCalendar object that backs the DateFormat, even if a
  constant was passed to the constructor, i.e., if an IntlCalendar
  was not passed to the constructor.
* Added IntlDateFormatter::setTimeZone(). It accepts the usual values
  for time zone arguments. If NULL is passed, the time zone of the
  IntlDateFormatter WILL be overridden with the default time zone,
  even if an IntlCalendar object was passed to the constructor.
* Added IntlDateFormatter::getTimeZone(), which returns the time zone
  that's associated with the DateFormat.
* Depreacated IntlDateFormatter::setTimeZoneId() and made it an alias
  for IntlDateFormatter::setTimeZone(), as the new ::setTimeZone()
  also accepts plain identifiers, besides other types.
  IntlDateFormatter::getTimeZoneId() is not deprecated however.
* IntlDateFormatter::setCalendar() with a constant passed should now
  work correctly. This requires saving the requested locale to the
  constructor.
* Centralized the hacks required to avoid compilation disasters on
  Windows due to some headers being included inside and outside of
  extern "C" blocks.
2012-06-04 00:01:48 +02:00
Felipe Pena
f327f13204 - Fixed ZTS build 2010-11-21 17:41:33 +00:00
Felipe Pena
167e51f36c - Fixed ZTS build 2010-11-21 17:41:33 +00:00
Stanislav Malyshev
0ba1cd1bd2 Add support for DateTime in datefmt_format 2010-11-20 02:09:04 +00:00
Stanislav Malyshev
4415b3af51 Add support for DateTime in datefmt_format 2010-11-20 02:09:04 +00:00
Stanislav Malyshev
d8c0c2203b fix formatting/parsing 2008-09-04 00:15:25 +00:00
Felipe Pena
eb1837d9de MFH:
- Added arginfo
- Fixed WS
- Changed C++ comments to C comments
2008-08-11 19:48:00 +00:00
Stanislav Malyshev
d54c396dca refactor ctors, cleanup code 2008-07-22 20:23:47 +00:00
Stanislav Malyshev
9eb22ce7f7 Merge intl extension 2008-07-07 23:10:15 +00:00