app/controllers/schedules_controller.rb
# move to previous or next simple calendar
move to previous or next simple calendar
move to previous or next simple calendar
def move_simple_calendar
    template       = "schedules/simple_calendar"
    div_id         = "simple_calendar"
    move_direction = params[:move_direction]
    if move_direction == "0"
      display_time = @show_time
    else     
      original_display_time = params[:display_time].to_datetime(:local)
      display_time = original_display_time.send(move_direction, 1.month)    
    end
    render :update do |page|
      page.replace div_id , :partial => template, :locals => {:display_time => display_time}
    end   
  end
def move_simple_calendar template = "schedules/simple_calendar" div_id = "simple_calendar" move_direction = params [ :move_direction ] if move_direction == "0" display_time = @show_time else original_display_time = params [ :display_time ] . to_datetime ( :local ) display_time = original_display_time . send ( move_direction , 1 . month ) end render :update do | page | page . replace div_id , :partial => template , :locals => { :display_time => display_time } end end
move to previous or next simple calendar
move to previous or next simple calendar