Extract methods to show a phase start/end
This commit is contained in:
@@ -10,4 +10,16 @@ class Admin::BudgetPhases::PhasesComponent < ApplicationComponent
|
||||
def phases
|
||||
budget.phases.order(:id)
|
||||
end
|
||||
|
||||
def start_date(phase)
|
||||
formatted_date(phase.starts_at)
|
||||
end
|
||||
|
||||
def end_date(phase)
|
||||
formatted_date(phase.ends_at)
|
||||
end
|
||||
|
||||
def formatted_date(time)
|
||||
l(time.to_date) if time.present?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user