-
-
Save eqbal/f89be6dc073851f6f3afe507bbcf54bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module EntriesHelper | |
def readable_time_period(entry) | |
mins = entry.time_period | |
return Time.at(60 * mins).utc.strftime('%M <small>Mins</small>').html_safe if mins < 60 | |
Time.at(60 * mins).utc.strftime('%H <small>Hour</small> %M <small>Mins</small>').html_safe | |
end | |
def readable_speed(entry) | |
"#{sprintf('%0.2f', entry.speed)} <small>Km/H</small>".html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment