Correctly format Budget's phases dates

This commit is contained in:
Bertocq
2018-01-23 02:07:49 +01:00
parent c41a8482d1
commit 599442440b
3 changed files with 48 additions and 46 deletions

View File

@@ -31,8 +31,10 @@
<% end %>
</td>
<td>
<% 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 %>
<em><%= t("admin.budgets.edit.blank_dates") %></em>
<% end %>

View File

@@ -3,9 +3,9 @@
<li class="phase <%= 'active' if phase == @budget.current_phase %>">
<h3><%= t("budgets.phase.#{phase.kind}") %></h3>
<span>
<%= 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? %>
</span>
<p><%= safe_html_with_links(phase.summary) %></p>
</li>

View File

@@ -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