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/measurements_helper.rb
2019-12-10 20:37:36 +01:00

28 lines
519 B
Ruby

module MeasurementsHelper
def format_datetime(m)
m.taken_at.getlocal.strftime("%F <small>%R</small>").html_safe
end
def format_time(m)
m.taken_at.getlocal.strftime("%R")
end
def quantity_options
nested_set_options(@project.quantities.measurement) do |q|
raw("#{'&ensp;' * q.level}#{q.name}")
end
end
def unit_options
@project.units.map do |u|
[u.shortname, u.id]
end
end
def source_options
@project.sources.map do |s|
[s.name, s.id]
end
end
end