eitil 1.1.3 → 1.1.4
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b566e2911d13c9952ef93916e929e1bf4666790e2d07934ccc3cb7d00f421319
|
4
|
+
data.tar.gz: d492741da447ce1777c79a07c1968acc611f558eec690d933c3e8eff94422f4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27376302a08134d0f7b14d55c4dda41eabd230b93cd1bce4f719d12505241e817779fc4feaa83e03443cc910516e33e477c10760ed9be7d5c543b2b53d98e2ae
|
7
|
+
data.tar.gz: 2fe73ac66fe0ef8bfc64260fc95e05f4a5c8dee3c8f7afb2c376da25fc65b1b93ab8da6b008bbb5d31537789d1c8b697258f87dbf9bde956f3c849ffa7e46bd1
|
@@ -10,9 +10,12 @@ module EitilIntegrate::RubyXL
|
|
10
10
|
format_ints_to_floats
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
# outcommented method in favour of AutoSum#chronic_sum_array: no longer accept days, since the method excepts
|
14
|
+
# either hh:mm or hh:mm:ss
|
15
|
+
|
16
|
+
# def format_time_strings
|
17
|
+
# @hash.transform_values! { |array| array.map { |item| incomplete_time_string?(item) ? "#{item}:00" : item } }
|
18
|
+
# end
|
16
19
|
|
17
20
|
def incomplete_time_string?(string)
|
18
21
|
string.is_a?(String) && string.length == 5 && string.scan(/\d{2}:\d{2}/)
|
@@ -22,15 +22,30 @@ module EitilIntegrate::RubyXL
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def chronic_sum_array(array)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
25
|
+
|
26
|
+
#total minutes, hours and days
|
27
|
+
tm, th, td = [0]*3
|
28
|
+
|
29
|
+
array.each do |time_string|
|
30
|
+
|
31
|
+
# add empty 0's, to avoid defining nil values when time values are absent
|
32
|
+
h, m, s = *time_string.split(':').map(&:to_i), *[0]*3
|
33
|
+
tm += m; th += h
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
# parsing times into maxes (60 m, 24 h, ∞ days)
|
38
|
+
th += tm / 60
|
39
|
+
tm = tm % 60
|
40
|
+
td += th / 24
|
41
|
+
th = th % 24
|
42
|
+
|
43
|
+
# formatting strings
|
44
|
+
sd = td.to_s
|
45
|
+
sh = th.to_s.rjust(2,'0')
|
46
|
+
sm = tm.to_s.rjust(2,'0')
|
47
|
+
|
48
|
+
[[sd, sh, sm].join(':')]
|
34
49
|
end
|
35
50
|
|
36
51
|
def format_time(time)
|
data/lib/eitil/version.rb
CHANGED