biz 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/biz/time.rb +7 -1
  3. data/lib/biz/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89a15e7c6f5161b0a1b5e1132b1f9b4cc0b2e7c4
4
- data.tar.gz: ff36ac8b0a4f6d2f6971c6fb8beaf36df09ac251
3
+ metadata.gz: 7d16f3fcb143fead794e794f17195778043ff611
4
+ data.tar.gz: 4958afc77a8fddaa749a543c353d88209a213e35
5
5
  SHA512:
6
- metadata.gz: 71f2ab477908d44026f15f4a10a09dd8ba6396ae871e998f29ebe58b15c1f2919959b8bf1fc11f648ab726050f9aa16272ccf5ce52f9b87ca73a8444485cc150
7
- data.tar.gz: 93a8e96e6e8e3df4957cb66844b1d0b253db0e300cde2deec5cb6a01b73a2dcfbd179b26d7943687129968cbca559782f6e27213992c5023071cb26b13b6ce71
6
+ metadata.gz: b70ed92768f8ae067bcb6cbf3c5f837682555879a92e84a805f6b5d0311a18867523f0d4d01b2f57f72b8d7e5385639f46542f77a636a848c9b83ed2c58a43c5
7
+ data.tar.gz: 5d5ad52048db8ad7d800edbb05c4162f0ed311a8d45fd0596b157fcb098d1dd462c51f8362b9ed10c2afe72c6ad0d76eb2a7527d4cd3519f982c37fcc60822e5
data/lib/biz/time.rb CHANGED
@@ -12,6 +12,7 @@ module Biz
12
12
 
13
13
  MINUTES_IN_DAY = MINUTES_IN_HOUR * HOURS_IN_DAY
14
14
  MINUTES_IN_WEEK = MINUTES_IN_DAY * DAYS_IN_WEEK
15
+ SECONDS_IN_DAY = MINUTES_IN_DAY * 60
15
16
 
16
17
  BIG_BANG = ::Time.new(-10**100)
17
18
  HEAT_DEATH = ::Time.new(10**100)
@@ -39,7 +40,12 @@ module Biz
39
40
  true
40
41
  )
41
42
  rescue TZInfo::PeriodNotFound
42
- on_date(date, DayTime.new(day_time.day_second + HOUR))
43
+ next_day_second = day_time.day_second + HOUR
44
+ if next_day_second > SECONDS_IN_DAY
45
+ on_date(date + 1, DayTime.new(next_day_second % SECONDS_IN_DAY))
46
+ else
47
+ on_date(date, DayTime.new(next_day_second))
48
+ end
43
49
  end
44
50
 
45
51
  def during_week(week, week_time)
data/lib/biz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Biz
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Little
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-01 00:00:00.000000000 Z
12
+ date: 2015-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: abstract_type
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.4.5.1
181
+ rubygems_version: 2.2.2
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Business hours calculations