Module: Gravitext::DateSupport
- Defined in:
- lib/gravitext-util/date_support.rb
Defined Under Namespace
Constant Summary collapse
- SEC_TO_MS =
One second in milliseconds
1_000
- MIN_TO_MS =
One minute in milliseconds
60 * 1_000
- HOUR_TO_MS =
One hour in milliseconds
60 * 60 * 1_000
- DAY_TO_MS =
One day in milliseconds
24 * 60 * 60 * 1_000
Instance Method Summary collapse
-
#d_days(v) ⇒ Object
Return TimeDelta gioven Numeric days.
-
#d_hours(v) ⇒ Object
Return TimeDelta gioven Numeric hours.
-
#d_mins(v) ⇒ Object
Return TimeDelta given Numeric minutes.
-
#d_secs(v) ⇒ Object
Return TimeDelta given Numeric seconds.
Instance Method Details
#d_days(v) ⇒ Object
Return TimeDelta gioven Numeric days
53 54 55 |
# File 'lib/gravitext-util/date_support.rb', line 53 def d_days( v ) TimeDelta.new( DAY_TO_MS * v ) end |
#d_hours(v) ⇒ Object
Return TimeDelta gioven Numeric hours
48 49 50 |
# File 'lib/gravitext-util/date_support.rb', line 48 def d_hours( v ) TimeDelta.new( HOUR_TO_MS * v ) end |