Sha256: ab48cdb4cc16e5515a65a44d286af7a6d44758fe87a1d4b20d852209a9d7a1ab
Contents?: true
Size: 854 Bytes
Versions: 2
Compression:
Stored size: 854 Bytes
Contents
class SalesforceController < ::ApplicationController def calendar_json_data events = Salesforce::Rails::API::CalendarEvent.query("StartDateTime >= #{Time.at(params[:start].to_i).strftime("%Y-%m-%dT%H:%M:%SZ")} and StartDateTime <= #{Time.at(params[:end].to_i).strftime("%Y-%m-%dT%H:%M:%SZ")}") respond_to do |format| format.json { render json: events ? events.map { |e| { :id => e.Id, :title => (e.IsAllDayEvent ? "All Day Event" : e.Subject), :allDay => e.IsAllDayEvent, :start => e.StartDateTime, :end => e.EndDateTime, :start_date => e.StartDateTime, :end_date => e.EndDateTime, :color => (e.ShowAs == "Busy" ? "#6777cc" : "#b64b32"), :backgroundColor => (e.ShowAs == "Busy" ? "#6777cc" : "#b64b32"), :subject => e.Subject, :assign_to => e.Owner.Name, :description => e.Description, :show_as => e.ShowAs } } : nil } end end end
Version data entries
2 entries across 2 versions & 1 rubygems