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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user