tracks/app/views/preferences/_date_and_time.html.erb
Reinier Balt e58379e81f This fixes failing tests when the timezone is different than utc
There were several problems:
* Time.now returns the systems time, not the users time
* fixtures do not translate dates from timezone to utc, but stores the
  date verbatim
* calling a controller will set the timezone to the preference of the
  current_user. So it could be changed while you do not realize this. I
  fixed the failing test, but problems could be elsewhere
2015-08-05 11:50:33 +02:00

22 lines
1.1 KiB
Text

<%= pref_with_text_field('prefs', 'date_format') %>
<div class='prefs_example'>This will result in: <span id='prefs.date_format'><%= l(Time.zone.today, :format => current_user.prefs.date_format) %></span></div>
<br/>
Or pick one of the following:<br/>
<% %w{default short long longer}.each do |format| %>
<%= radio_button_tag("date_picker1", t("date.formats.#{format}")) %> <%= l(Time.zone.today, :format => format.to_sym) %> <br/>
<% end %>
<br/>
<%= pref_with_text_field('prefs', 'title_date_format') %>
<div class='prefs_example'>This will result in: <span id='prefs.title_date_format'><%= l(Time.zone.today, :format => current_user.prefs.title_date_format) %></span></div>
<br/>
Or pick one of the following:<br/>
<% %w{default short long longer}.each do |format| %>
<%= radio_button_tag("date_picker2", t("date.formats.#{format}")) %> <%= l(Time.zone.today, :format => format.to_sym) %> <br/>
<% end %>
<br/>
<%= pref('prefs', 'time_zone') { time_zone_select('prefs','time_zone') } %>
<%= pref_with_select_field('prefs', "week_starts", (0..6).to_a.map {|num| [t('date.day_names')[num], num] }) %>