-
-
Save anonymous/425a677fd0fff1a043cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#arrays for comparison / overlaping / conflicts | |
aAction = Array.new | |
aAccepted = Array.new | |
results.data.items.each do |event| | |
#Listet alle Events | |
puts "=> SUMMARY: #{event.summary}" | |
puts "=> START: #{event.start.dateTime}" | |
puts "=> STATUS: #{event.attendees[0].responseStatus}" | |
puts "=> INVITER: #{event.organizer.email}" | |
puts "=> ID: #{event.id}" | |
if event.attendees[0].responseStatus == "needsAction" | |
puts "[NEEDS ACTION ARRAY]" | |
aAction.push({:sData=> "#{event.start.dateTime}", :eData => "#{event.end.dateTime}"}) | |
puts aAction | |
# if event.start.dateTime.between?(event2.start.dateTime,event2.start.dateTime) || event.end.dateTime.between?(event2.start.dateTime,event2.start.dateTime) | |
# put conflicting | |
end | |
if event.attendees[0].responseStatus == "accepted" | |
puts "[ACCEPTED EVENTS ARRAY]" | |
aAccepted.push({:sData=> "#{event.start.dateTime}", :eData => "#{event.end.dateTime}"}) | |
puts aAccepted | |
end | |
#[NEEDS ACTION ARRAY] | |
#{:sData=>"2015-07-22 10:00:00 +0200", :eData=>"2015-07-22 11:00:00 +0200"} | |
#{:sData=>"2015-07-23 08:30:00 +0200", :eData=>"2015-07-23 09:30:00 +0200"} | |
#{:sData=>"2015-07-24 12:00:00 +0200", :eData=>"2015-07-24 13:00:00 +0200"} | |
#EXAMPLE OUTPUT! how to compare for overlapping events ?! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment