Search in sources :

Example 1 with TimezoneInfo

use of biweekly.io.TimezoneInfo in project substitution-schedule-parser by vertretungsplanme.

the class BaseIcalParser method getTimeZoneStart.

private TimeZone getTimeZoneStart(ICalendar ical, VEvent event) {
    if (event.getDateStart() == null) {
        return null;
    }
    TimezoneInfo tzinfo = ical.getTimezoneInfo();
    TimeZone timezone;
    if (tzinfo.isFloating(event.getDateStart())) {
        timezone = TimeZone.getDefault();
    } else {
        TimezoneAssignment dtstartTimezone = tzinfo.getTimezone(event.getDateStart());
        timezone = (dtstartTimezone == null) ? TimeZone.getTimeZone("UTC") : dtstartTimezone.getTimeZone();
    }
    return timezone;
}
Also used : TimezoneInfo(biweekly.io.TimezoneInfo) TimezoneAssignment(biweekly.io.TimezoneAssignment)

Aggregations

TimezoneAssignment (biweekly.io.TimezoneAssignment)1 TimezoneInfo (biweekly.io.TimezoneInfo)1