Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1028555 // googleCalendar_eventsInDateRange

JavaX fragment (include) [tags: use-pretranspiled]

Uses 4337K of libraries. Click here for Pure Java version (2689L/17K).

please include class GoogleAccess.

import com.google.api.client.util.DateTime;
import com.google.api.services.calendar.Calendar;
import com.google.api.services.calendar.model.Event;
import com.google.api.services.calendar.model.Events;

static L<Event> googleCalendar_eventsInDateRange(Calendar calendarService, TimeZone tz, long startDate, long endDate, int maxEvents) {
  ret googleCalendar_eventsInDateRange(calendarService, tz, longRange(startDate, endDate), maxEvents);
}

static L<Event> googleCalendar_eventsInDateRange(Calendar calendarService, TimeZone tz, LongRange dateRange, int maxEvents) ctex {
  Events events = calendarService.events().list("primary")
    .setMaxResults(maxEvents)
    .setTimeMin(new DateTime(new java.util.Date(dateRange.start), tz))
    .setTimeMax(new DateTime(new java.util.Date(dateRange.end), tz))
    .setOrderBy("startTime")
    .setSingleEvents(true)
    .execute();
  ret events.getItems();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028555
Snippet name: googleCalendar_eventsInDateRange
Eternal ID of this version: #1028555/7
Text MD5: ad4c738898f25452f6d4d8b3647dbdd2
Transpilation MD5: 98b7002048fa28d12b17dcacca0b9afc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-28 18:27:02
Source code size: 957 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 219 / 322
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)