From 465d417c3561db00c8d4f44bf983c4737f479d80 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 20 Jun 2013 12:47:44 +0800 Subject: [PATCH] fixed updated method of events.. was having week error when updating events --- .../panel/calendar/back_end/events_controller.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb index c28391d5..134b0465 100644 --- a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb +++ b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb @@ -95,8 +95,7 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController start_week = final_start_time.strftime("%U") start_week = start_week.to_i + 1 end_week = final_end_time.strftime("%U") - end_week = end_week.to_i + 1 - debugger + end_week = end_week.to_i + 1 total_days = final_end_time - final_start_time @event = Event.new @event.title = title @@ -156,6 +155,12 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController # if end_am_pm == "PM" # temp_end_time = $endtime + 12 # end + if params[:event][:cal_id] + cal_id = params[:event][:cal_id] + else + cal_id = Cal.first.id.to_s + end + if params[:all_day] all_day = true $starttime = 0 @@ -167,7 +172,9 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController final_start_time = Date.new(start_year.to_i,start_month.to_i,start_date.to_i) final_end_time = Date.new(end_year.to_i,end_month.to_i,end_date.to_i) start_week = final_start_time.strftime("%U") - end_week = final_end_time.strftime("%U") + start_week = start_week.to_i + 1 + end_week = final_end_time.strftime("%U") + end_week = end_week.to_i + 1 total_days = final_end_time - final_start_time @event = Event.find(params[:id]) @event.title = title