summarylogtreecommitdiffstats
path: root/icu59.diff
blob: 59117a54dbe67a7c5a9e5ef7702a1ac8e7117f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/src/i18n.cc b/src/i18n.cc
index 79a70daf62..7a8d847034 100644
--- a/src/i18n.cc
+++ b/src/i18n.cc
@@ -28,7 +28,7 @@
 #include "unicode/rbbi.h"
 #include "unicode/smpdtfmt.h"
 #include "unicode/timezone.h"
-#include "unicode/uchar.h"
+#include "unicode/ustring.h"
 #include "unicode/ucol.h"
 #include "unicode/ucurr.h"
 #include "unicode/unum.h"
@@ -180,7 +180,13 @@ void SetResolvedDateSettings(Isolate* isolate,
   icu::UnicodeString canonical_time_zone;
   icu::TimeZone::getCanonicalID(time_zone, canonical_time_zone, status);
   if (U_SUCCESS(status)) {
-    if (canonical_time_zone == UNICODE_STRING_SIMPLE("Etc/GMT")) {
+    // In CLDR (http://unicode.org/cldr/trac/ticket/9943), Etc/UTC is made
+    // a separate timezone ID from Etc/GMT even though they're still the same
+    // timezone. We'd not have "Etc/GMT" here because we canonicalize it and
+    // other GMT-variants to "UTC" in intl.js and "UTC" is turned to "Etc/UTC"
+    // by ICU before getting here.
+    DCHECK(canonical_time_zone != UNICODE_STRING_SIMPLE("Etc/GMT"));
+    if (canonical_time_zone == UNICODE_STRING_SIMPLE("Etc/UTC")) {
       JSObject::SetProperty(
           resolved, factory->NewStringFromStaticChars("timeZone"),
           factory->NewStringFromStaticChars("UTC"), SLOPPY).Assert();