26 lines
408 B
Ruby
26 lines
408 B
Ruby
helpers do
|
|
|
|
def nullable(value)
|
|
if (value) and (value != '')
|
|
return value
|
|
else
|
|
return 'N/a'
|
|
end
|
|
end
|
|
|
|
def date_format(date)
|
|
dt = date.to_datetime
|
|
return dt.strftime('%B %d, %Y, %I:%M:%S %p')
|
|
end
|
|
|
|
def date_format_input(date)
|
|
dt = date.to_datetime
|
|
return dt.strftime('%Y-%m-%dT%H:%M:%S')
|
|
end
|
|
|
|
def serialize(num)
|
|
return num.to_s.rjust(4, '0')
|
|
end
|
|
|
|
end
|