From 599442440bbb59213e746f0c211eab36e6f3133e Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 23 Jan 2018 02:07:49 +0100 Subject: [PATCH] Correctly format Budget's phases dates --- app/views/admin/budgets/_form.html.erb | 6 +- app/views/budgets/_phases.html.erb | 4 +- config/locales/es/rails.yml | 84 +++++++++++++------------- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/app/views/admin/budgets/_form.html.erb b/app/views/admin/budgets/_form.html.erb index 1636db3fa..5ec6a3213 100644 --- a/app/views/admin/budgets/_form.html.erb +++ b/app/views/admin/budgets/_form.html.erb @@ -31,8 +31,10 @@ <% end %> - <% if phase.starts_at.present? && phase.ends_at.present? %> - <%= l phase.starts_at.to_date %> - <%= l phase.ends_at.to_date %> + <% if phase.starts_at.present? || phase.ends_at.present? %> + <%= l(phase.starts_at.to_date) if phase.starts_at.present? %> + - + <%= l(phase.ends_at.to_date - 1.day) if phase.ends_at.present? %> <% else %> <%= t("admin.budgets.edit.blank_dates") %> <% end %> diff --git a/app/views/budgets/_phases.html.erb b/app/views/budgets/_phases.html.erb index 09ed14ea4..1d0968c46 100644 --- a/app/views/budgets/_phases.html.erb +++ b/app/views/budgets/_phases.html.erb @@ -3,9 +3,9 @@
  • <%= t("budgets.phase.#{phase.kind}") %>

    - <%= format_date(phase.starts_at) if phase.starts_at.present? %> + <%= l(phase.starts_at.to_date, format: :long) if phase.starts_at.present? %> - - <%= format_date(phase.ends_at - 1.day) if phase.ends_at.present? %> + <%= l(phase.ends_at.to_date - 1.day, format: :long) if phase.ends_at.present? %>

    <%= safe_html_with_links(phase.summary) %>

  • diff --git a/config/locales/es/rails.yml b/config/locales/es/rails.yml index 82737ab6c..3328478d7 100644 --- a/config/locales/es/rails.yml +++ b/config/locales/es/rails.yml @@ -1,55 +1,55 @@ es: date: abbr_day_names: - - dom - - lun - - mar - - mié - - jue - - vie - - sáb + - dom + - lun + - mar + - mié + - jue + - vie + - sáb abbr_month_names: - - ene - - feb - - mar - - abr - - may - - jun - - jul - - ago - - sep - - oct - - nov - - dic + - ene + - feb + - mar + - abr + - may + - jun + - jul + - ago + - sep + - oct + - nov + - dic day_names: - - domingo - - lunes - - martes - - miércoles - - jueves - - viernes - - sábado + - domingo + - lunes + - martes + - miércoles + - jueves + - viernes + - sábado formats: default: "%d/%m/%Y" long: "%d de %B de %Y" short: "%d de %b" month_names: - - enero - - febrero - - marzo - - abril - - mayo - - junio - - julio - - agosto - - septiembre - - octubre - - noviembre - - diciembre + - enero + - febrero + - marzo + - abril + - mayo + - junio + - julio + - agosto + - septiembre + - octubre + - noviembre + - diciembre order: - - :day - - :month - - :year + - :day + - :month + - :year datetime: distance_in_words: about_x_hours: @@ -196,4 +196,4 @@ es: long: "%d de %B de %Y %H:%M" short: "%d de %b %H:%M" api: "%d/%m/%Y %H" - pm: pm + pm: pm \ No newline at end of file