Revert "Refactoring"

This reverts commit cb94d4d6ca.
This commit is contained in:
M66B 2023-10-26 12:51:49 +02:00
parent 7b5ec0ce7d
commit 6d3125876a
1 changed files with 8 additions and 11 deletions

View File

@ -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 +