Use a time HTML tag to display phases dates

Currently this change is barely beneficial (if at all), but it doesn't
harm and might be useful in some cases. For instance, the `datetime`
attributes generates a date containing time zone information, which the
text shown on the screen does not, and styling dates with CSS is now
easier.
This commit is contained in:
Javi Martín
2021-03-05 17:02:16 +01:00
parent a2a6ae7bdd
commit b37eaf19c6
2 changed files with 3 additions and 3 deletions

View File

@@ -20,6 +20,6 @@ class Admin::BudgetPhases::PhasesComponent < ApplicationComponent
end
def formatted_date(time)
l(time.to_date) if time.present?
time_tag(time.to_date, format: :default) if time.present?
end
end

View File

@@ -13,11 +13,11 @@ class Budgets::PhasesComponent < ApplicationComponent
end
def start_date(phase)
l(phase.starts_at.to_date, format: :long) if phase.starts_at.present?
time_tag(phase.starts_at.to_date, format: :long) if phase.starts_at.present?
end
def end_date(phase)
l(phase.ends_at.to_date - 1.day, format: :long) if phase.ends_at.present?
time_tag(phase.ends_at.to_date - 1.day, format: :long) if phase.ends_at.present?
end
def phase_dom_id(phase)