mirror of
https://github.com/php/php-src.git
synced 2024-10-02 07:16:11 +00:00
ec23c3e540
Now MessageFormatter::format() accepts IntlCalendar objects to be used in arguments of type Format::kDate.
30 lines
756 B
PHP
30 lines
756 B
PHP
--TEST--
|
|
MessageFormat accepts IntlCalendar args
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('intl'))
|
|
die('skip intl extension not enabled');
|
|
--FILE--
|
|
<?php
|
|
ini_set("intl.error_level", E_WARNING);
|
|
//ini_set("intl.default_locale", "nl");
|
|
ini_set('date.timezone', 'Europe/Lisbon');
|
|
|
|
$cal = new IntlGregorianCalendar(2012,04,17,17,35,36);
|
|
|
|
$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}');
|
|
echo $msgf->format(array($cal)), "\n";
|
|
|
|
//NOT FIXED:
|
|
/*$msgf = new MessageFormatter('en_US',
|
|
'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
|
|
|
|
echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
|
|
$msgf->format(array($time, 'time')), "\n";
|
|
*/
|
|
|
|
?>
|
|
==DONE==
|
|
--EXPECT--
|
|
Quinta-feira, 17 de Maio de 2012 5:35:36 p.m. WEST
|
|
==DONE==
|