Exemplo n.º 1
0
 public static Recurrence noRecur() {
   Recurrence r = new Recurrence();
   r.startDate = Calendar.getInstance();
   r.pattern = RecurrencePattern.noRecur();
   r.period = RecurrencePeriod.noEndDate();
   return r;
 }
Exemplo n.º 2
0
 public static Recurrence parse(String recurrence) {
   Recurrence r = new Recurrence();
   String[] a = recurrence.split("~");
   try {
     Date d = DateUtils.FORMAT_TIMESTAMP_ISO_8601.parse(a[0]);
     Calendar c = Calendar.getInstance();
     c.setTime(d);
     r.startDate = c;
   } catch (ParseException e) {
     throw new RuntimeException(recurrence);
   }
   r.pattern = RecurrencePattern.parse(a[1]);
   r.period = RecurrencePeriod.parse(a[2]);
   return r;
 }