Revert "Refactoring"

This reverts commit cb94d4d6ca.
pull/214/head
M66B 12 months ago
parent 7b5ec0ce7d
commit 6d3125876a

@ -118,18 +118,11 @@ public class CalendarHelper {
ICalDate start = (event.getDateStart() == null ? null : event.getDateStart().getValue());
ICalDate end = (event.getDateEnd() == null ? null : event.getDateEnd().getValue());
TimezoneInfo tzinfo = icalendar.getTimezoneInfo();
TimezoneAssignment tza = (tzinfo == null ? null : tzinfo.getTimezone(event.getDateStart()));
TimeZone tz = (tza == null ? null : tza.getTimeZone());
//if (tz != null && "W. Europe Standard Time".equals(tz.getID()))
// tz.setID("GMT");
String tzid = (tz == null ? TimeZone.getDefault().getID() : tz.getID());
String rrule = null;
RecurrenceRule recurrence = event.getRecurrenceRule();
if (recurrence != null) {
RecurrenceRuleScribe scribe = new RecurrenceRuleScribe();
WriteContext wcontext = new WriteContext(ICalVersion.V2_0, tzinfo, null);
WriteContext wcontext = new WriteContext(ICalVersion.V2_0, icalendar.getTimezoneInfo(), null);
rrule = scribe.writeText(recurrence, wcontext);
}
@ -170,7 +163,11 @@ public class CalendarHelper {
values.put(CalendarContract.Events.ORGANIZER, organizer);
// Assume one time zone
values.put(CalendarContract.Events.EVENT_TIMEZONE, tzid);
TimezoneInfo tzinfo = icalendar.getTimezoneInfo();
TimezoneAssignment tza = (tzinfo == null ? null : tzinfo.getTimezone(event.getDateStart()));
TimeZone tz = (tza == null ? null : tza.getTimeZone());
values.put(CalendarContract.Events.EVENT_TIMEZONE,
tz == null ? TimeZone.getDefault().getID() : tz.getID());
values.put(CalendarContract.Events.DTSTART, start.getTime());
values.put(CalendarContract.Events.DTEND, end.getTime());
@ -194,7 +191,7 @@ public class CalendarHelper {
" id=" + calId + ":" + eventId +
" uid=" + uid +
" organizer=" + organizer +
" tz=" + tzid +
" tz=" + (tz == null ? null : tz.getID()) +
" start=" + new Date(start.getTime()) +
" end=" + new Date(end.getTime()) +
" rrule=" + rrule +
@ -208,7 +205,7 @@ public class CalendarHelper {
" id=" + calId + ":" + existId +
" uid=" + uid +
" organizer=" + organizer +
" tz=" + tzid +
" tz=" + (tz == null ? null : tz.getID()) +
" start=" + new Date(start.getTime()) +
" end=" + new Date(end.getTime()) +
" rrule=" + rrule +

Loading…
Cancel
Save