calc_working_hours 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73ddb049d9a154805169b8652c041af264ee9929
4
- data.tar.gz: 330bfbe9885b3ed1002c4449c7023b8b02a99651
3
+ metadata.gz: 7f0a5e07377bd56b85dc77768af2c3296a35b806
4
+ data.tar.gz: 59163eb3f55f73f1097166007ffe03fe14c54198
5
5
  SHA512:
6
- metadata.gz: 66b9cf8473a184cb9ab4d1360b449505a5849a70ae5914b50963991d7ce6f18cc76d9ee408e4de2d81c9721c21d3fb6d85b035deaf655af972aefbf8f4121008
7
- data.tar.gz: 0566bdf7e01e887c9dcea80ea469c93e4d0f7b588bbc5e18db381732af371eb3ff04407e37ae52d80af52070b7b231f1997cc8f124e08b9102f2a811328105b8
6
+ metadata.gz: 891a406cee7236b82a51773cf17042124ba714115eda529f0e838686fc438903a89158fcae146b0e73617c694ab1b5be98921c398eb016ccc2a7116d57aa8bf6
7
+ data.tar.gz: 72d41baa7dba82af0cd3806def34a8d1f602e6df03793252c8873da43673ad29d8ea9b2edb5db51bd68f3c990fb97ca279120d6456281dc2bcfe3e95fa98da89
@@ -7,14 +7,22 @@ module CalcWorkingHours
7
7
  class TimeCardRow
8
8
  attr_reader :starting_time, :ending_time, :break_time, :working_hours, :date_string, :time_point, :over_time, :id
9
9
  def initialize(date_string, starting_time, ending_time, auto_correction, *break_time)
10
-
11
10
  if auto_correction
11
+ if starting_time == nil || ending_time == nil
12
+ starting_time = "0:00"
13
+ ending_time = "0:00"
14
+ end
12
15
  unless CalcHelper.valid_time_order?(starting_time, ending_time)
13
16
  et = WorkingHours.new(ending_time)
14
17
  ending_time = et.add_time("24:00").time_string
15
18
  end
16
19
  unless break_time.empty?
17
20
  break_time.map! do |time|
21
+ if starting_time == nil || ending_time == nil
22
+ starting_time = "0:00"
23
+ ending_time = "0:00"
24
+ time = ["0:00", "0:00"]
25
+ end
18
26
  unless CalcHelper.valid_time_order?(starting_time, time[0])
19
27
  et = WorkingHours.new(time[0])
20
28
  time[0] = et.add_time("24:00").time_string
@@ -1,3 +1,3 @@
1
1
  module CalcWorkingHours
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calc_working_hours
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi_U