TimezoneParser 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/timezone_parser/data.rb +1 -3
- data/lib/timezone_parser/version.rb +1 -1
- data/spec/rails_zone_spec.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 66302503c34bf0dff90ad0082e5c0bf4e94e479ff65c0e0e1e7348a295cdf21d
|
4
|
+
data.tar.gz: 1fd2ecc75983613f786bdb20e6549ee8dae8d5421db2dcd363cd4933b04f040b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc413688f2df13c437cbf6fe6bb58b4f46ca6a8f9bf1b618e86902b39a292e97b2c55a13184a718618914309185b064345fc77d89d66c5fe0ccfb4ec4af21382
|
7
|
+
data.tar.gz: 6dde6ef33d0bd68fc25e07cd48e537ed96240045487b5e08ed912143ae8ddb4c4001368e4dc9c19af144ee31e11667c5dd86bd78ccb1bb443ce6e96370351c1d
|
data/lib/timezone_parser/data.rb
CHANGED
@@ -53,12 +53,10 @@ module TimezoneParser
|
|
53
53
|
end
|
54
54
|
next unless tz
|
55
55
|
offsets = []
|
56
|
-
|
56
|
+
self.class.addOffset(offsets, tz.period_for_utc(fromTime).offset, types)
|
57
57
|
tz.transitions_up_to(toTime, fromTime).each do |transition|
|
58
|
-
ts = true
|
59
58
|
self.class.addOffset(offsets, transition.offset, types)
|
60
59
|
end
|
61
|
-
self.class.addOffset(offsets, tz.period_for_utc(toTime - 0.001).offset, types) unless ts
|
62
60
|
@Offsets += offsets
|
63
61
|
end
|
64
62
|
@Offsets
|
data/spec/rails_zone_spec.rb
CHANGED
@@ -58,7 +58,9 @@ describe TimezoneParser do
|
|
58
58
|
|
59
59
|
describe '.getOffsets' do
|
60
60
|
it 'should return all offsets for "Nuku\'alofa"' do
|
61
|
-
expect(TimezoneParser::RailsZone::getOffsets('Nuku\'alofa', DateTime.
|
61
|
+
expect(TimezoneParser::RailsZone::getOffsets('Nuku\'alofa', DateTime.parse('2018-01-01T00:00:00+00:00'), nil, ['en', 'ru'])).to eq([46800, 50400])
|
62
|
+
expect(TimezoneParser::RailsZone::getOffsets('Nuku\'alofa', DateTime.parse('2017-01-15T02:59:59+14:00'), DateTime.parse('2016-11-06T02:00:00+13:00'), ['en', 'ru'])).to eq([50400])
|
63
|
+
expect(TimezoneParser::RailsZone::getOffsets('Nuku\'alofa', DateTime.parse('2018-07-01T00:00:00+00:00'), DateTime.parse('2017-01-15T03:00:00+14:00'), ['en', 'ru'])).to eq([46800])
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: TimezoneParser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dāvis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
232
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.
|
233
|
+
rubygems_version: 2.7.7
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Parse Timezone names written in any language to offsets and TimeZone identifiers
|