jsTimezoneDetect-rails 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3780cb3cd9ac5b60753a001c6814fea32e4cd11a
4
- data.tar.gz: 4728060dad04731b9d4e2ddda6ef93bbda9b3b70
3
+ metadata.gz: bcb9bfaa2c13c535d76647c5db2f0688fd0c70ba
4
+ data.tar.gz: 5c3cd598dc507f39b424804b1d0e48a0a107245e
5
5
  SHA512:
6
- metadata.gz: 65b5d338105e4f27d9bcc3ed971bd008eec28b02b99b02d224d5c6e32aab1bf14501e1faf1a8185e6aed043daa360675a0782e46097262b0b3be4c83df61284f
7
- data.tar.gz: 59eab9327e913604ba95f9380e5bbb350a41dd641ef49f67ae6a60defcc2697aa65e5a51c2b30ff8a7c91df54a4a09ebae4d80deb31e5f6eee61f1a71b753a21
6
+ metadata.gz: 8c098f761ecf175e3d533b7dbc262c3ed553de6fdae4b79d89b37aece9b7a1dc1505668985012b98dd300fa8729b72d656eb09ab21c7e8ab4b23aa6932e7a66f
7
+ data.tar.gz: 71cd8987cbbe60b690ac1728d00df0e8ef80b5bace722e1ce1bbcc4e3e731dce14d75cbea8a80352d6ff5119e17613999d82cd22526a033397f8c82aba5fcf54
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # jsTimezoneDetect-rails
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/jsTimezoneDetect-rails.svg)](http://badge.fury.io/rb/jsTimezoneDetect-rails)
4
+
3
5
  This is a wrapper for the [jsTimezoneDetect.js](https://bitbucket.org/pellepim/jstimezonedetect) library, which makes it ready for use with the asset pipeline, provided by Rails 4.0 and higher. The gem includes the non-minified version of the library.
4
6
 
5
7
  ## Installation
@@ -1,5 +1,5 @@
1
1
  module JsTimezoneDetect
2
2
  module Rails
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@
3
3
  * This script gives you the zone info key representing your device's time zone setting.
4
4
  *
5
5
  * @name jsTimezoneDetect
6
- * @version 1.0.5
6
+ * @version 1.0.6
7
7
  * @author Jon Nylander
8
8
  * @license MIT License - https://bitbucket.org/pellepim/jstimezonedetect/src/default/LICENCE.txt
9
9
  *
@@ -30,9 +30,10 @@ var jstz = (function () {
30
30
  MAX_SCORE: 864000000, // 10 days
31
31
  AMBIGUITIES: {
32
32
  'America/Denver': ['America/Mazatlan'],
33
+ 'Europe/London': ['Africa/Casablanca'],
33
34
  'America/Chicago': ['America/Mexico_City'],
34
- 'America/Santiago': ['America/Asuncion', 'America/Campo_Grande'],
35
- 'America/Montevideo': ['America/Sao_Paulo'],
35
+ 'America/Asuncion': ['America/Campo_Grande', 'America/Santiago'],
36
+ 'America/Montevideo': ['America/Sao_Paulo', 'America/Santiago'],
36
37
  // Europe/Minsk should not be in this list... but Windows.
37
38
  'Asia/Beirut': ['Asia/Amman', 'Asia/Jerusalem', 'Europe/Helsinki', 'Asia/Damascus', 'Africa/Cairo', 'Asia/Gaza', 'Europe/Minsk'],
38
39
  'Pacific/Auckland': ['Pacific/Fiji'],
@@ -99,14 +100,23 @@ var jstz = (function () {
99
100
  * environments that support the ECMAScript Internationalization API.
100
101
  */
101
102
  get_from_internationalization_api = function get_from_internationalization_api() {
103
+ var format, timezone;
102
104
  if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") {
103
105
  return;
104
106
  }
105
- var format = Intl.DateTimeFormat();
107
+
108
+ format = Intl.DateTimeFormat();
109
+
106
110
  if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") {
107
111
  return;
108
112
  }
109
- return format.resolvedOptions().timeZone;
113
+
114
+ timezone = format.resolvedOptions().timeZone;
115
+
116
+ if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC')) {
117
+ return timezone;
118
+ }
119
+
110
120
  },
111
121
 
112
122
  /**
@@ -317,8 +327,10 @@ var jstz = (function () {
317
327
 
318
328
  for (var tz in scoreboard) {
319
329
  if (scoreboard.hasOwnProperty(tz)) {
320
- if (ambiguities.indexOf(tz) != -1) {
321
- return tz;
330
+ for (var j = 0; j < ambiguities.length; j++) {
331
+ if (ambiguities[j] === tz) {
332
+ return tz;
333
+ }
322
334
  }
323
335
  }
324
336
  }
@@ -434,7 +446,7 @@ jstz.olson.timezones = {
434
446
  '-270,0': 'America/Caracas',
435
447
  '-240,1': 'America/Halifax',
436
448
  '-240,0': 'America/Santo_Domingo',
437
- '-240,1,s': 'America/Santiago',
449
+ '-240,1,s': 'America/Asuncion',
438
450
  '-210,1': 'America/St_Johns',
439
451
  '-180,1': 'America/Godthab',
440
452
  '-180,0': 'America/Argentina/Buenos_Aires',
@@ -488,7 +500,7 @@ jstz.olson.timezones = {
488
500
  '840,0': 'Pacific/Kiritimati'
489
501
  };
490
502
 
491
- /* Build time: 2014-11-28 11:10:50Z Build by invoking python utilities/dst.py generate */
503
+ /* Build time: 2015-11-02 13:01:00Z Build by invoking python utilities/dst.py generate */
492
504
  jstz.olson.dst_rules = {
493
505
  "years": [
494
506
  2008,
@@ -524,6 +536,39 @@ jstz.olson.dst_rules = {
524
536
  }
525
537
  ]
526
538
  },
539
+ {
540
+ "name": "Africa/Casablanca",
541
+ "rules": [
542
+ {
543
+ "e": 1220223600000,
544
+ "s": 1212278400000
545
+ },
546
+ {
547
+ "e": 1250809200000,
548
+ "s": 1243814400000
549
+ },
550
+ {
551
+ "e": 1281222000000,
552
+ "s": 1272758400000
553
+ },
554
+ {
555
+ "e": 1312066800000,
556
+ "s": 1301788800000
557
+ },
558
+ {
559
+ "e": 1348970400000,
560
+ "s": 1345428000000
561
+ },
562
+ {
563
+ "e": 1382839200000,
564
+ "s": 1376100000000
565
+ },
566
+ {
567
+ "e": 1414288800000,
568
+ "s": 1406944800000
569
+ }
570
+ ]
571
+ },
527
572
  {
528
573
  "name": "America/Asuncion",
529
574
  "rules": [
@@ -788,6 +833,39 @@ jstz.olson.dst_rules = {
788
833
  }
789
834
  ]
790
835
  },
836
+ {
837
+ "name": "America/Santiago",
838
+ "rules": [
839
+ {
840
+ "e": 1206846000000,
841
+ "s": 1223784000000
842
+ },
843
+ {
844
+ "e": 1237086000000,
845
+ "s": 1255233600000
846
+ },
847
+ {
848
+ "e": 1270350000000,
849
+ "s": 1286683200000
850
+ },
851
+ {
852
+ "e": 1304823600000,
853
+ "s": 1313899200000
854
+ },
855
+ {
856
+ "e": 1335668400000,
857
+ "s": 1346558400000
858
+ },
859
+ {
860
+ "e": 1367118000000,
861
+ "s": 1378612800000
862
+ },
863
+ {
864
+ "e": 1398567600000,
865
+ "s": 1410062400000
866
+ }
867
+ ]
868
+ },
791
869
  {
792
870
  "name": "America/Sao_Paulo",
793
871
  "rules": [
@@ -921,7 +999,7 @@ jstz.olson.dst_rules = {
921
999
  "s": 1364508000000
922
1000
  },
923
1001
  {
924
- "e": 1411678800000,
1002
+ "e": 1414098000000,
925
1003
  "s": 1395957600000
926
1004
  }
927
1005
  ]
@@ -1303,11 +1381,53 @@ jstz.olson.dst_rules = {
1303
1381
  "s": 1414850400000
1304
1382
  }
1305
1383
  ]
1384
+ },
1385
+ {
1386
+ "name": "Europe/London",
1387
+ "rules": [
1388
+ {
1389
+ "e": 1224982800000,
1390
+ "s": 1206838800000
1391
+ },
1392
+ {
1393
+ "e": 1256432400000,
1394
+ "s": 1238288400000
1395
+ },
1396
+ {
1397
+ "e": 1288486800000,
1398
+ "s": 1269738000000
1399
+ },
1400
+ {
1401
+ "e": 1319936400000,
1402
+ "s": 1301187600000
1403
+ },
1404
+ {
1405
+ "e": 1351386000000,
1406
+ "s": 1332637200000
1407
+ },
1408
+ {
1409
+ "e": 1382835600000,
1410
+ "s": 1364691600000
1411
+ },
1412
+ {
1413
+ "e": 1414285200000,
1414
+ "s": 1396141200000
1415
+ }
1416
+ ]
1306
1417
  }
1307
1418
  ]
1308
- }; if (typeof exports !== 'undefined') {
1309
- exports.jstz = jstz;
1419
+ };
1420
+ if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
1421
+ module.exports = jstz;
1422
+ } else if ((typeof define !== 'undefined' && define !== null) && (define.amd != null)) {
1423
+ define([], function() {
1424
+ return jstz;
1425
+ });
1426
+ } else {
1427
+ if (typeof root === 'undefined') {
1428
+ window.jstz = jstz;
1310
1429
  } else {
1311
1430
  root.jstz = jstz;
1312
1431
  }
1313
- })(this);
1432
+ }
1433
+ }());
metadata CHANGED
@@ -1,22 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsTimezoneDetect-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2017-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 4.0.0
@@ -24,9 +21,6 @@ dependencies:
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '4.0'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
26
  version: 4.0.0
@@ -64,9 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
58
  version: '0'
65
59
  requirements: []
66
60
  rubyforge_project:
67
- rubygems_version: 2.4.5
61
+ rubygems_version: 2.6.13
68
62
  signing_key:
69
63
  specification_version: 4
70
64
  summary: The jsTimezoneDetect.js library ready for Rails' asset pipeline.
71
65
  test_files: []
72
- has_rdoc: