ar_to_html_table 0.1.7 → 0.1.8
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.
- data/CHANGELOG +4 -0
- data/lib/ar_to_html_table/column_formatter.rb +8 -4
- data/lib/ar_to_html_table/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
ar_to_html_table (0.1.8) October 24, 2010
|
2
|
+
|
3
|
+
* Formatter seconds_to_time now omits the hours if the time is less than one hour.
|
4
|
+
|
1
5
|
ar_to_html_table (0.1.7) October 24, 2010
|
2
6
|
|
3
7
|
* Included ::ActionView::Helpers::DateHelper into column_formats so those methods can be use
|
@@ -68,12 +68,12 @@ module ArToHtmlTable
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# Interprets an integer as a duration and outputs the duration
|
71
|
-
# in the format hh:mm:ss
|
71
|
+
# in the format hh:mm:ss or mm:hh:ss if the time is less than an hour.
|
72
72
|
#
|
73
73
|
# ====Examples
|
74
74
|
#
|
75
75
|
# # Given a value of 3600, the formatter will output
|
76
|
-
# =>
|
76
|
+
# => 05:00
|
77
77
|
#
|
78
78
|
# val: the value to be formatted
|
79
79
|
# options: formatter options
|
@@ -84,9 +84,13 @@ module ArToHtmlTable
|
|
84
84
|
seconds = val % 60
|
85
85
|
(minutes += 1; seconds = 0) if seconds == 60
|
86
86
|
(hours += 1; minutes = 0) if minutes == 60
|
87
|
-
|
87
|
+
if hours > 0
|
88
|
+
"#{"%02d" % hours}:#{"%02d" % minutes}:#{"%02d" % seconds}"
|
89
|
+
else
|
90
|
+
"#{"%02d" % minutes}:#{"%02d" % seconds}"
|
91
|
+
end
|
88
92
|
end
|
89
|
-
|
93
|
+
|
90
94
|
# Interprets an integer as a number of hours and outputs the value
|
91
95
|
# in the format hh:00
|
92
96
|
#
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_to_html_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kip Cole
|