1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/helpers/body_trackers_helper.rb
2020-04-24 16:53:24 +02:00

24 lines
364 B
Ruby

module BodyTrackersHelper
def format_value(value)
amount, unit = value
case
when amount.nil?
'-'
when amount.nan?
'?'
else
"#{amount} [#{unit.shortname || '-'}]"
end
end
def format_time(t)
t.strftime("%R") if t
end
def unit_options
@project.units.map do |u|
[u.shortname, u.id]
end
end
end