mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
Fix calender. Events that are to old are filtered now.
This commit is contained in:
parent
3c68f3f064
commit
fbc032677c
1 changed files with 7 additions and 1 deletions
|
@ -62,7 +62,13 @@ class GoogleCalendar
|
|||
end
|
||||
|
||||
def request_url
|
||||
"#{BASE_URL}/#{@id}/#{@endpoint}/?key=#{ENV['GOOGLE_API_KEY']}"
|
||||
#The default number of events pulled is 250.
|
||||
#We reached that number and events didn't show any more.
|
||||
#So now I filter all events that have a start time
|
||||
#that is longer ago then 7 days.
|
||||
#Alternative: maxResults=2500
|
||||
time_min = (Time.now - 7.days).utc.iso8601
|
||||
"#{BASE_URL}/#{@id}/#{@endpoint}/?key=#{ENV['GOOGLE_API_KEY']}&timeMin=#{time_min}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue