Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.reportError('Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/')
return null
}
// The API expects an ISO8601 datetime with a time and timezone part.
// Since the calendar's timezone offset isn't always known, request the date in UTC and pad it by a day on each
// side, guaranteeing we will receive all events in the desired range, albeit a superset.
// .utc() will set a zone and give it a 00:00:00 time.
if (!start.hasZone()) {
start = start.clone().utc().add(-1, 'day')
}
if (!end.hasZone()) {
end = end.clone().utc().add(1, 'day')
}
params = assignTo(
this.ajaxSettings.data || {},
{
key: apiKey,
timeMin: start.format(),
timeMax: end.format(),
singleEvents: true,
maxResults: 9999
}
)
if (timezone && timezone !== 'local') {
// when sending timezone names to Google, only accepts underscores, not spaces
params.timeZone = timezone.replace(' ', '_')
}
return params
applyMiscProps(rawProps) {
if (!this.ajaxSettings) {
this.ajaxSettings = {}
}
assignTo(this.ajaxSettings, rawProps)
}