Include duration in budgets table
This commit is contained in:
committed by
Javi Martín
parent
fe05bfe9ea
commit
d2871d7770
@@ -20,7 +20,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<% if phase.starts_at.present? || phase.ends_at.present? %>
|
||||
<%= start_date(phase) %> - <%= end_date(phase) %>
|
||||
<%= dates(phase) %>
|
||||
<% else %>
|
||||
<em><%= t("admin.budgets.edit.blank_dates") %></em>
|
||||
<% end %>
|
||||
|
||||
@@ -11,15 +11,7 @@ class Admin::BudgetPhases::PhasesComponent < ApplicationComponent
|
||||
budget.phases.order(:id)
|
||||
end
|
||||
|
||||
def start_date(phase)
|
||||
formatted_date(phase.starts_at) if phase.starts_at.present?
|
||||
end
|
||||
|
||||
def end_date(phase)
|
||||
formatted_date(phase.ends_at - 1.second) if phase.ends_at.present?
|
||||
end
|
||||
|
||||
def formatted_date(time)
|
||||
time_tag(time, format: :datetime)
|
||||
def dates(phase)
|
||||
Admin::Budgets::DurationComponent.new(phase).dates
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user