com.google.api.services.calendar.model.Event.getStart()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中com.google.api.services.calendar.model.Event.getStart()方法的一些代码示例,展示了Event.getStart()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getStart()方法的具体详情如下:
包路径:com.google.api.services.calendar.model.Event
类名称:Event
方法名:getStart

Event.getStart介绍

暂无

代码示例

代码示例来源:origin: google/data-transfer-project

private static CalendarEventModel convertToCalendarEventModel(String id, Event eventData) {
 List<EventAttendee> attendees = eventData.getAttendees();
 List<String> recurrenceRulesStrings = eventData.getRecurrence();
 return new CalendarEventModel(
   id,
   eventData.getDescription(),
   eventData.getSummary(),
   attendees == null
     ? null
     : attendees
       .stream()
       .map(GoogleCalendarExporter::transformToModelAttendee)
       .collect(Collectors.toList()),
   eventData.getLocation(),
   getEventTime(eventData.getStart()),
   getEventTime(eventData.getEnd()),
   recurrenceRulesStrings == null ? null : getRecurrenceRule(recurrenceRulesStrings));
}

代码示例来源:origin: google/google-api-java-client-samples

static void display(Event event) {
  if (event.getStart() != null) {
   System.out.println("Start Time: " + event.getStart());
  }
  if (event.getEnd() != null) {
   System.out.println("End Time: " + event.getEnd());
  }
 }
}

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

private static boolean inPast(Event event) {
  if (event.getStart().getDateTime() != null)
    return event.getStart().getDateTime().getValue() <= System.currentTimeMillis();
  else
    return event.getStart().getDate().getValue() <= System.currentTimeMillis();
}

代码示例来源:origin: io.syndesis.connector/connector-google-calendar

model.setAttendees(getAttendeesString(event.getAttendees()));
if (ObjectHelper.isNotEmpty(event.getStart())) {
  if (event.getStart().getDateTime() != null) {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDateTime().getValue())));
    model.setStartTime(timeFormat.format(new Date(event.getStart().getDateTime().getValue())));
  } else {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDate().getValue())));

代码示例来源:origin: io.syndesis.connector/connector-google-calendar

model.setAttendees(getAttendeesString(event.getAttendees()));
if (ObjectHelper.isNotEmpty(event.getStart())) {
  if (event.getStart().getDateTime() != null) {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDateTime().getValue())));
    model.setStartTime(timeFormat.format(new Date(event.getStart().getDateTime().getValue())));
  } else {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDate().getValue())));

代码示例来源:origin: io.syndesis.connector/connector-google-calendar

model.setAttendees(getAttendeesString(event.getAttendees()));
if (ObjectHelper.isNotEmpty(event.getStart())) {
  if (event.getStart().getDateTime() != null) {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDateTime().getValue())));
    model.setStartTime(timeFormat.format(new Date(event.getStart().getDateTime().getValue())));
  } else {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDate().getValue())));

代码示例来源:origin: io.syndesis.connector/connector-google-calendar

model.setAttendees(getAttendeesString(event.getAttendees()));
if (ObjectHelper.isNotEmpty(event.getStart())) {
  if (event.getStart().getDateTime() != null) {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDateTime().getValue())));
    model.setStartTime(timeFormat.format(new Date(event.getStart().getDateTime().getValue())));
  } else {
    model.setStartDate(dateFormat.format(new Date(event.getStart().getDate().getValue())));

代码示例来源:origin: gdenning/exchange-sync

if (feed.getItems() != null) {
  for (final Event event : feed.getItems()) {
    final org.joda.time.DateTime eventStartDate = convertToJodaDateTime(event.getStart());
    final org.joda.time.DateTime eventEndDate = coalesce(convertToJodaDateTime(event.getEnd()),
        convertToJodaDateTime(event.getStart()));
    if (eventStartDate != null && eventEndDate != null
        && (eventEndDate.isAfter(startDate) || eventEndDate.isEqual(startDate))

代码示例来源:origin: gsuitedevs/java-samples

public static void main(String... args) throws IOException, GeneralSecurityException {
    // Build a new authorized API client service.
    final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
    Calendar service = new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))
        .setApplicationName(APPLICATION_NAME)
        .build();

    // List the next 10 events from the primary calendar.
    DateTime now = new DateTime(System.currentTimeMillis());
    Events events = service.events().list("primary")
        .setMaxResults(10)
        .setTimeMin(now)
        .setOrderBy("startTime")
        .setSingleEvents(true)
        .execute();
    List<Event> items = events.getItems();
    if (items.isEmpty()) {
      System.out.println("No upcoming events found.");
    } else {
      System.out.println("Upcoming events");
      for (Event event : items) {
        DateTime start = event.getStart().getDateTime();
        if (start == null) {
          start = event.getStart().getDate();
        }
        System.out.printf("%s (%s)\n", event.getSummary(), start);
      }
    }
  }
}

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

JSONObject jo = new JSONObject();
jo.put("id", e.getId());
jo.put("epochStart", e.getStart().getDateTime().getValue());
jo.put("epochEnd", e.getEnd().getDateTime().getValue());

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

JSONObject jo = new JSONObject();
jo.put("id", e.getId());
jo.put("epochStart", e.getStart().getDateTime().getValue());
jo.put("epochEnd", e.getEnd().getDateTime().getValue());

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

JSONObject jo = new JSONObject();
jo.put("id", e.getId());
jo.put("epochStart", e.getStart().getDateTime().getValue());
jo.put("epochEnd", e.getEnd().getDateTime().getValue());

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

JSONObject jo = new JSONObject();
jo.put("id", e.getId());
jo.put("epochStart", e.getStart().getDateTime().getValue());
jo.put("epochEnd", e.getEnd().getDateTime().getValue());
jo.put("timezone", tz);

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

JSONObject jo = new JSONObject();
jo.put("id", e.getId());
jo.put("epochStart", e.getStart().getDateTime().getValue());
jo.put("epochEnd", e.getEnd().getDateTime().getValue());
jo.put("timezone", tz);

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

JSONObject jo = new JSONObject();
jo.put("id", e.getId());
jo.put("epochStart", e.getStart().getDateTime().getValue());
jo.put("epochEnd", e.getEnd().getDateTime().getValue());
jo.put("timezone", tz);

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

startDateTime = e.getStart();
endDateTime = e.getEnd();
  if (e.getStart().getDateTime() != null) {
    viewableStartDate = new EventDateTime().setDateTime(new DateTime(TimeUtils.applyTimeZoneOffset(e.getStart().getDateTime().getValue(), cal.getTimeZone())));
    viewableEndDate = new EventDateTime().setDateTime(new DateTime(TimeUtils.applyTimeZoneOffset(e.getEnd().getDateTime().getValue(), cal.getTimeZone())));
  } else {
    viewableStartDate = new EventDateTime().setDate(new DateTime(TimeUtils.applyTimeZoneOffset(e.getStart().getDate().getValue(), cal.getTimeZone())));
    viewableEndDate = new EventDateTime().setDate(new DateTime(TimeUtils.applyTimeZoneOffset(e.getEnd().getDate().getValue(), cal.getTimeZone())));
  viewableStartDate = e.getStart();
  viewableEndDate = e.getEnd();

代码示例来源:origin: gdenning/exchange-sync

result.setSummary(event.getSummary());
result.setDescription(event.getDescription());
result.setStart(convertToJodaDateTime(event.getStart()));
result.setEnd(convertToJodaDateTime(event.getEnd()));
if (event.getEnd().getDateTime() != null) {

相关文章