Skip to content

Commit 221012e

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [Intl][Form] Update tests, TimeZoneTransformer, and DateTimeToLocalizedStringTransformer for the GMT and UTC split in ICU [Intl] Update ICU data to 59.1
2 parents 54f24e1 + a9f63ee commit 221012e

File tree

920 files changed

+1460
-1091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

920 files changed

+1460
-1091
lines changed

DateFormatter/DateFormat/TimeZoneTransformer.php

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,29 @@ public function format(\DateTime $dateTime, $length)
3535
throw new NotImplementedException('Time zone different than GMT or UTC is not supported as a formatting output.');
3636
}
3737

38-
// From ICU >= 4.8, the zero offset is not more used, example: GMT instead of GMT+00:00
39-
$format = (0 !== (int) $dateTime->format('O')) ? '\G\M\TP' : '\G\M\T';
38+
if ('Etc' === $timeZone) {
39+
// i.e. Etc/GMT+1, Etc/UTC, Etc/Zulu
40+
$timeZone = substr($dateTime->getTimezone()->getName(), 4);
41+
}
42+
43+
// From ICU >= 59.1 GMT and UTC are no longer unified
44+
if (in_array($timeZone, array('UTC', 'UCT', 'Universal', 'Zulu'))) {
45+
// offset is not supported with UTC
46+
return $length > 3 ? 'Coordinated Universal Time' : 'UTC';
47+
}
48+
49+
$offset = (int) $dateTime->format('O');
50+
51+
// From ICU >= 4.8, the zero offset is no more used, example: GMT instead of GMT+00:00
52+
if (0 === $offset) {
53+
return $length > 3 ? 'Greenwich Mean Time' : 'GMT';
54+
}
55+
56+
if ($length > 3) {
57+
return $dateTime->format('\G\M\TP');
58+
}
4059

41-
return $dateTime->format($format);
60+
return sprintf('GMT%s%d', ($offset >= 0 ? '+' : ''), $offset / 100);
4261
}
4362

4463
/**

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ Resources
1515
* [Report issues](https://github.com/symfony/symfony/issues) and
1616
[send Pull Requests](https://github.com/symfony/symfony/pulls)
1717
in the [main Symfony repository](https://github.com/symfony/symfony)
18+
* [Docker images with intl support](https://hub.docker.com/r/jakzal/php-intl)
19+
(for the Intl component development)
1820

1921
[0]: http://www.php.net/manual/en/intl.setup.php

Resources/bin/icu.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
55 = http://source.icu-project.org/repos/icu/icu/tags/release-55-1/source
1515
57 = http://source.icu-project.org/repos/icu/icu/tags/release-57-1/source
1616
58 = http://source.icu-project.org/repos/icu/tags/release-58-2/icu4c/source
17+
59 = http://source.icu-project.org/repos/icu/tags/release-59-1/icu4c/source

Resources/data/currencies/af.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.29.44",
2+
"Version": "2.1.32.59",
33
"Names": {
44
"AED": [
55
"AED",
@@ -451,7 +451,7 @@
451451
],
452452
"PEN": [
453453
"PEN",
454-
"Peruaanse nuwe sol"
454+
"Peruaanse sol"
455455
],
456456
"PGK": [
457457
"PGK",

Resources/data/currencies/af_NA.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.27.40",
2+
"Version": "2.1.31.33",
33
"Names": {
44
"NAD": [
55
"$",

Resources/data/currencies/ak.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.27.40",
2+
"Version": "2.1.31.33",
33
"Names": {
44
"AED": [
55
"AED",

Resources/data/currencies/am.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.28.79",
2+
"Version": "2.1.32.59",
33
"Names": {
44
"AED": [
55
"AED",
@@ -439,7 +439,7 @@
439439
],
440440
"PEN": [
441441
"PEN",
442-
"የፔሩቪያ ኑኤቮ ሶል"
442+
"የፔሩቪያ ሶል"
443443
],
444444
"PGK": [
445445
"PGK",

Resources/data/currencies/ar.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.28.79",
2+
"Version": "2.1.32.86",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -647,7 +647,7 @@
647647
],
648648
"PEN": [
649649
"PEN",
650-
"سول جديد البيرو"
650+
"سول البيرو"
651651
],
652652
"PGK": [
653653
"PGK",

Resources/data/currencies/ar_DJ.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.27.40",
2+
"Version": "2.1.31.33",
33
"Names": {
44
"DJF": [
55
"Fdj",

Resources/data/currencies/ar_ER.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.27.40",
2+
"Version": "2.1.31.33",
33
"Names": {
44
"ERN": [
55
"Nfk",

0 commit comments

Comments
 (0)