Removed dirty fix for handling timezones since the core sets timezones correctly,

added showing timezones so the user know the timezones used
pull/6827/head
Sebastian Schuster 12 years ago
parent 9460c83dd6
commit ffe13e5903
  1. 10
      app/controllers/meetings_controller.rb
  2. 2
      app/views/meetings/_form.html.erb
  3. 2
      app/views/meetings/show.html.erb

@ -49,7 +49,7 @@ class MeetingsController < ApplicationController
if @meeting.save if @meeting.save
text = l(:notice_successful_create) text = l(:notice_successful_create)
if User.current.time_zone.nil? if User.current.time_zone.nil?
link = l(:notice_timezone_missing, :zone => Time.now.zone) link = l(:notice_timezone_missing, :zone => Time.zone)
text += " #{view_context.link_to(link, {:controller => :my, :action => :account},:class => "link_to_profile")}" text += " #{view_context.link_to(link, {:controller => :my, :action => :account},:class => "link_to_profile")}"
end end
flash[:notice] = text.html_safe flash[:notice] = text.html_safe
@ -112,13 +112,7 @@ class MeetingsController < ApplicationController
start_time_5i = params[:meeting].delete(:"start_time(5i)") start_time_5i = params[:meeting].delete(:"start_time(5i)")
begin begin
timestring = "#{start_date} #{start_time_4i}:#{start_time_5i}" timestring = "#{start_date} #{start_time_4i}:#{start_time_5i}"
if(User.current.time_zone.nil?) time = Time.zone.parse(timestring)
time = Time.parse(timestring) #using the system time zone
else
Time.use_zone(User.current.time_zone) do
time = Time.zone.parse(timestring) #using the user-set time zone
end
end
params[:meeting][:start_time] = time params[:meeting][:start_time] = time
rescue ArgumentError rescue ArgumentError
params[:meeting][:start_time] = nil params[:meeting][:start_time] = nil

@ -3,7 +3,7 @@
<div class="box tabular"> <div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :class => "autofocus" %></p> <p><%= f.text_field :title, :required => true, :size => 60, :class => "autofocus" %></p>
<p><%= f.text_field :location, :size => 60 %></p> <p><%= f.text_field :location, :size => 60 %></p>
<p><%= f.text_field :start_date, :required => true, :size => 10 %><%= calendar_for('meeting_start_date') %> <%= time_select "meeting", "start_time", :ignore_date => true, :minute_step => 5 %></p> <p><%= f.text_field :start_date, :required => true, :size => 10 %><%= calendar_for('meeting_start_date') %> <%= time_select "meeting", "start_time", :ignore_date => true, :minute_step => 5 %> <%= Time.zone %></p>
<p><%= f.text_field :duration, :required => true, :size => 5 %><em>(<%=l :text_in_hours %>)</em> <p><%= f.text_field :duration, :required => true, :size => 5 %><em>(<%=l :text_in_hours %>)</em>
<div><label><%=l :field_participants %></label> <div><label><%=l :field_participants %></label>
<table class="list"> <table class="list">

@ -11,7 +11,7 @@
<%= avatar(@meeting.author, :size => "64") %> <%= avatar(@meeting.author, :size => "64") %>
<p class="author"><%= authoring @meeting.created_at, @meeting.author %></p> <p class="author"><%= authoring @meeting.created_at, @meeting.author %></p>
<div class="splitcontentleft"> <div class="splitcontentleft">
<p><strong><%= l(:field_start_time) %></strong>: <%= format_date @meeting.start_date %> <%= format_time @meeting.start_time, false %> - <%= format_time @meeting.end_time, false %></p> <p><strong><%= l(:field_start_time) %></strong>: <%= format_date @meeting.start_date %> <%= format_time @meeting.start_time, false %> - <%= format_time @meeting.end_time, false %> <%= Time.zone %></p>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
<p><strong><%= l(:field_location) %></strong>: <%=h @meeting.location %></p> <p><strong><%= l(:field_location) %></strong>: <%=h @meeting.location %></p>

Loading…
Cancel
Save