time_of_day_attr 3.0.0.beta.3 → 3.0.0
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/README.md +1 -1
- data/lib/time_of_day_attr/seconds.rb +5 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0cc52b0fb94fb30d40279c7ec292ea48e2ae7e
|
4
|
+
data.tar.gz: 6ea3ff89b9c408dd7f795574990bf1c140bec4a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6967049988bbd33cc92bb2c4a67b39cd85aba9a82679a96d0ae53145a931e10634c38d91b3381debd880561f4fdfad46b61dca83292bffae1f795700d43dc08
|
7
|
+
data.tar.gz: 9a687a0155b4b24ccd0424e3d4f80a90811843c260b1736b6a769ddb43fb2d56fe47cd5a288649974848718074987504fda6b8e897908f77fe9619d92dfbf1d8
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Time of day attributes for your Rails model
|
2
2
|
[](http://badge.fury.io/rb/time_of_day_attr) [](https://codeclimate.com/github/clemenst/time_of_day_attr) [](http://clemenst.mit-license.org)
|
3
3
|
|
4
|
-
This ruby gem converts time of day to seconds since midnight and back. The
|
4
|
+
This ruby gem converts time of day to seconds (since midnight) and back. The value in seconds can be used for calculations and validations.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -7,8 +7,11 @@ module TimeOfDayAttr
|
|
7
7
|
time_format = TimeFormat.translate_format(format)
|
8
8
|
|
9
9
|
time_of_day = seconds_to_time_of_day(value, time_format)
|
10
|
-
|
11
|
-
|
10
|
+
if options[:omit_minutes_at_full_hour]
|
11
|
+
TimeOfDay.omit_minutes_at_full_hour(time_of_day)
|
12
|
+
else
|
13
|
+
time_of_day
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
def self.seconds_to_time_of_day(value, time_format)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_of_day_attr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clemens Teichmann
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description: This ruby gem converts time of day to seconds since midnight and back.
|
41
|
+
description: This ruby gem converts time of day to seconds (since midnight) and back.
|
42
42
|
The value in seconds can be used for calculations and validations.
|
43
43
|
email:
|
44
44
|
- clemens_t@web.de
|
@@ -78,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
86
|
rubygems_version: 2.5.2.1
|