mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Timezone/rrule
This commit is contained in:
parent
0c8f553ac0
commit
0f60b6b751
1 changed files with 39 additions and 0 deletions
|
@ -39,6 +39,7 @@ import java.util.TimeZone;
|
|||
|
||||
import biweekly.ICalVersion;
|
||||
import biweekly.ICalendar;
|
||||
import biweekly.component.ICalComponent;
|
||||
import biweekly.component.VAlarm;
|
||||
import biweekly.component.VEvent;
|
||||
import biweekly.io.TimezoneAssignment;
|
||||
|
@ -109,6 +110,44 @@ public class CalendarHelper {
|
|||
}
|
||||
}
|
||||
|
||||
if (false) {
|
||||
// BEGIN:VCALENDAR
|
||||
// METHOD:REQUEST
|
||||
// PRODID:Microsoft Exchange Server 2010
|
||||
// VERSION:2.0
|
||||
// BEGIN:VTIMEZONE
|
||||
// TZID:W. Europe Standard Time
|
||||
// BEGIN:STANDARD
|
||||
// DTSTART:16010101T030000
|
||||
// TZOFFSETFROM:+0200
|
||||
// TZOFFSETTO:+0100
|
||||
// RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
|
||||
// END:STANDARD
|
||||
// BEGIN:DAYLIGHT
|
||||
// DTSTART:16010101T020000
|
||||
// TZOFFSETFROM:+0100
|
||||
// TZOFFSETTO:+0200
|
||||
// RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
|
||||
// END:DAYLIGHT
|
||||
// END:VTIMEZONE
|
||||
// BEGIN:VEVENT
|
||||
// UID:...
|
||||
// DTSTART;TZID=W. Europe Standard Time:20231030T100000
|
||||
// DTEND;TZID=W. Europe Standard Time:20231030T110000
|
||||
// ...
|
||||
for (TimezoneAssignment assignment : icalendar.getTimezoneInfo().getTimezones()) {
|
||||
for (List<ICalComponent> components : assignment.getComponent().getComponents().getMap().values())
|
||||
for (ICalComponent component : components) {
|
||||
RecurrenceRule recurrence = component.getProperty(RecurrenceRule.class);
|
||||
if (recurrence != null) {
|
||||
RecurrenceRuleScribe scribe = new RecurrenceRuleScribe();
|
||||
WriteContext wcontext = new WriteContext(ICalVersion.V2_0, icalendar.getTimezoneInfo(), null);
|
||||
String rrule = scribe.writeText(recurrence, wcontext);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String organizer = (event.getOrganizer() == null ? null : event.getOrganizer().getEmail());
|
||||
|
||||
String summary = (event.getSummary() == null ? null : event.getSummary().getValue());
|
||||
|
|
Loading…
Reference in a new issue