calc_working_hours 0.3.1 → 0.3.2
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 +4 -4
- data/lib/calc_working_hours/calc_helper.rb +6 -1
- data/lib/calc_working_hours/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0047ebcca2b690bd15b5398b9459ebbd465ab178
|
4
|
+
data.tar.gz: e1e1c511a76a51aea4bc1e631b0ce5a5603b76f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 282823665e7a2b62047210bdc7b9385c28e6775d34e00d5c5790eecddd8bd6f8cf0b91f4ea7a5b9e55019b7b0a5926e3e9e23d5c36356c370a174eedd0d55b93
|
7
|
+
data.tar.gz: 0b065bef664a247d9dbfdf17ecc8e1f7e158e5eed338d049ca9b8a51958fdd9670e01106ba011684df1faffb46c9e51f301f9b35d741e1be89d7945b4f8f1274
|
@@ -41,6 +41,9 @@ module CalcWorkingHours
|
|
41
41
|
def valid_break_time?(break_time, starting_time, ending_time)
|
42
42
|
flag = false
|
43
43
|
break_time.each do |time|
|
44
|
+
unless time
|
45
|
+
return flag = true
|
46
|
+
end
|
44
47
|
if time.length == 2 && time.class == Array
|
45
48
|
if valid_time_format?(time[0]) && valid_time_format?(time[1])
|
46
49
|
time.each do |t|
|
@@ -60,7 +63,9 @@ module CalcWorkingHours
|
|
60
63
|
def total_break_time(break_time)
|
61
64
|
total = WorkingHours.new("0:00")
|
62
65
|
break_time.each do |time|
|
63
|
-
|
66
|
+
unless time
|
67
|
+
total.add_time(time[1]).minus_time(time[0])
|
68
|
+
end
|
64
69
|
end
|
65
70
|
return total
|
66
71
|
end
|