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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0cd2f7add9bd7865eabb212a3eb738681ceab43c
4
- data.tar.gz: 9db1c17a8894110d2e6fcde60077ff30296a39a6
2
+ SHA256:
3
+ metadata.gz: 66302503c34bf0dff90ad0082e5c0bf4e94e479ff65c0e0e1e7348a295cdf21d
4
+ data.tar.gz: 1fd2ecc75983613f786bdb20e6549ee8dae8d5421db2dcd363cd4933b04f040b
5
5
  SHA512:
6
- metadata.gz: b2973864779926a11b8ddcb63cbedba4d78a315692257c0e11f6596a35b83e3ea947cb07ae29dbf7fae0101f1200497752e55b7e089f37a9466fba6cf8e79834
7
- data.tar.gz: cee3e66b241e26837b60b5dd39b4a38b528f0994186cf7fb1c6a407f35fa9fd27dc9fe4269cf7824c308b48602a35b4aba9feaabce9b04ac56fc4612aae3392a
6
+ metadata.gz: cc413688f2df13c437cbf6fe6bb58b4f46ca6a8f9bf1b618e86902b39a292e97b2c55a13184a718618914309185b064345fc77d89d66c5fe0ccfb4ec4af21382
7
+ data.tar.gz: 6dde6ef33d0bd68fc25e07cd48e537ed96240045487b5e08ed912143ae8ddb4c4001368e4dc9c19af144ee31e11667c5dd86bd78ccb1bb443ce6e96370351c1d
@@ -53,12 +53,10 @@ module TimezoneParser
53
53
  end
54
54
  next unless tz
55
55
  offsets = []
56
- ts = false
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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  module TimezoneParser
3
3
  # Version
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.3'
5
5
  end
@@ -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.now, nil, ['en', 'ru'], true)).to eq([46800, 50400])
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.2
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: 2017-08-12 00:00:00.000000000 Z
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.6.12
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