Display the time a phase ends at in admin section

This commit is contained in:
Julian Herrero
2020-03-16 12:54:00 +01:00
committed by Javi Martín
parent b37eaf19c6
commit d20e521ee9
2 changed files with 11 additions and 11 deletions

View File

@@ -12,14 +12,14 @@ class Admin::BudgetPhases::PhasesComponent < ApplicationComponent
end
def start_date(phase)
formatted_date(phase.starts_at)
formatted_date(phase.starts_at) if phase.starts_at.present?
end
def end_date(phase)
formatted_date(phase.ends_at)
formatted_date(phase.ends_at - 1.second) if phase.ends_at.present?
end
def formatted_date(time)
time_tag(time.to_date, format: :default) if time.present?
time_tag(time, format: :datetime)
end
end