Update interval_helper to accept hours. (#960)

This commit is contained in:
Three Planets Software 2023-05-01 13:19:49 -04:00 committed by GitHub
parent f3ab19ee1c
commit 2981689c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
module IntervalHelper
TIME_INTERVALS = { "d" => "Day", "w" => "Week", "m" => "Month", "y" => "Year" }.freeze
TIME_INTERVALS = { "h" => "Hour",
"d" => "Day",
"w" => "Week",
"m" => "Month",
"y" => "Year", }.freeze
def time_interval(param)
if (m = param.to_s.match(/\A(\d+)([#{TIME_INTERVALS.keys.join}])\z/))