cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [05/14] cordova-plugin-globalization git commit: CB-11154 (Windows) Return IANA timezone as an empty string instead of undefined
Date Thu, 27 Apr 2017 19:50:05 GMT
CB-11154 (Windows) Return IANA timezone as an empty string instead of undefined


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/commit/24a7eb4f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/tree/24a7eb4f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/diff/24a7eb4f

Branch: refs/heads/1.0.x
Commit: 24a7eb4faa363a82d5f73c8441dd266921d44627
Parents: 83f6cce
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Tue Jan 10 18:16:52 2017 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Tue Jan 10 18:16:52 2017 +0300

----------------------------------------------------------------------
 README.md                                       |   2 ++
 src/windows/GlobalizationProxy.winmd            | Bin 20992 -> 22528 bytes
 .../Globalization/GlobalizationApiTypes.cs      |  10 +++++++++-
 .../Globalization/GlobalizationImpl.cs          |   2 +-
 tests/tests.js                                  |   9 ++++++---
 5 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/24a7eb4f/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index d298789..36fdf44 100644
--- a/README.md
+++ b/README.md
@@ -500,6 +500,8 @@ a popup dialog with text such as `pattern: M/d/yyyy h:mm a`:
 
 - The `timezone` returns the full time zone name.
 
+- The `iana_timezone` property is not supported, and always returns empty string.
+
 - The `dst_offset` property is not supported, and always returns zero.
 
 - The pattern may be not completely aligned with ICU depending on a user locale.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/24a7eb4f/src/windows/GlobalizationProxy.winmd
----------------------------------------------------------------------
diff --git a/src/windows/GlobalizationProxy.winmd b/src/windows/GlobalizationProxy.winmd
index bf61069..92925b3 100644
Binary files a/src/windows/GlobalizationProxy.winmd and b/src/windows/GlobalizationProxy.winmd
differ

http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/24a7eb4f/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationApiTypes.cs
----------------------------------------------------------------------
diff --git a/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationApiTypes.cs
b/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationApiTypes.cs
index 5641b21..9a27351 100644
--- a/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationApiTypes.cs
+++ b/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationApiTypes.cs
@@ -395,6 +395,12 @@ namespace GlobalizationProxy.Globalization
         public string TimeZone { get; set; }
 
         /// <summary>
+        /// IANA TimeZone
+        /// </summary>
+        [DataMember(Name = "iana_timezone", IsRequired = false)]
+        public string IanaTimeZone { get; set; }
+
+        /// <summary>
         /// UTC offset
         /// </summary>
         [DataMember(Name = "utc_offset", IsRequired = false)]
@@ -411,12 +417,14 @@ namespace GlobalizationProxy.Globalization
         /// </summary>
         /// <param name="pattern"></param>
         /// <param name="timezone"></param>
+        /// <param name="ianaTimezone"></param>
         /// <param name="utcOffset"></param>
         /// <param name="dstOffset"></param>
-        public DatePattern(string pattern, string timezone, double utcOffset, double dstOffset)
+        public DatePattern(string pattern, string timezone, string ianaTimezone, double utcOffset,
double dstOffset)
         {
             this.Pattern = pattern;
             this.TimeZone = timezone;
+            this.IanaTimeZone = ianaTimezone;
             this.UtcOffset = utcOffset;
             this.DstOffset = dstOffset;
         }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/24a7eb4f/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationImpl.cs
----------------------------------------------------------------------
diff --git a/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationImpl.cs
b/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationImpl.cs
index 7e2b772..fd5d227 100644
--- a/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationImpl.cs
+++ b/src/windows/GlobalizationProxy/GlobalizationProxy/Globalization/GlobalizationImpl.cs
@@ -349,7 +349,7 @@ namespace GlobalizationProxy.Globalization
             }
 
             TimeZoneInfo localZone = TimeZoneInfo.Local;
-            return new DatePattern(pattern, localZone.DisplayName, localZone.BaseUtcOffset.TotalSeconds,
0);
+            return new DatePattern(pattern, localZone.DisplayName, String.Empty, localZone.BaseUtcOffset.TotalSeconds,
0);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/24a7eb4f/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 010fc74..30e8398 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -263,9 +263,12 @@ exports.defineAutoTests = function () {
                     expect(a.timezone.length > 0).toBe(true);
                 }
                 if (!isBrowser && !isWindowsPhone) {
-                  expect(a.iana_timezone).toBeDefined();
-                  expect(typeof a.iana_timezone).toBe('string');
-                  expect(a.iana_timezone.length > 0).toBe(true);
+                    expect(a.iana_timezone).toBeDefined();
+                    expect(typeof a.iana_timezone).toBe('string');
+                    // Windows doesn't support IANA timezone and always returns an empty
string instead
+                    if (!isWindows) {
+                        expect(a.iana_timezone.length > 0).toBe(true);
+                    }
                 }
                 expect(a.utc_offset).toBeDefined();
                 expect(typeof a.utc_offset).toBe('number');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message