From b37eaf19c6b66be43a39de151ed4df3da976bc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 5 Mar 2021 17:02:16 +0100 Subject: [PATCH] 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. --- app/components/admin/budget_phases/phases_component.rb | 2 +- app/components/budgets/phases_component.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/admin/budget_phases/phases_component.rb b/app/components/admin/budget_phases/phases_component.rb index dfa0fbee6..8f45deede 100644 --- a/app/components/admin/budget_phases/phases_component.rb +++ b/app/components/admin/budget_phases/phases_component.rb @@ -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 diff --git a/app/components/budgets/phases_component.rb b/app/components/budgets/phases_component.rb index 18f1d82d3..467e6ca79 100644 --- a/app/components/budgets/phases_component.rb +++ b/app/components/budgets/phases_component.rb @@ -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)