Class RecurrenceRule

java.lang.Object
org.daypilot.recurrence.RecurrenceRule

public class RecurrenceRule extends Object
  • Field Details

    • NOREPEAT

      public static final RecurrenceRule NOREPEAT
      Specifies that the event does not recur.
    • EXCEPTION

      public static final RecurrenceRule EXCEPTION
      Specifies that this event represents an exception from rule defined in the main event.
  • Method Details

    • getId

      public String getId()
    • setId

      public void setId(String value)
    • getRangeSpec

      public RecurrenceRule.RangeSpecType getRangeSpec()
    • setRangeSpec

      public void setRangeSpec(RecurrenceRule.RangeSpecType value)
    • getUntilValue

      public DateTime getUntilValue()
    • getTimesValue

      public Integer getTimesValue()
    • fromDateTime

      public static RecurrenceRule fromDateTime(String id, DateTime start)
      Creates a new RecurrenceRule from starting DateTime. It prefills certain fields but it's still necessary to specify it further by calling methods like Weekly(). Event id. Starting DateTime.
    • monthly

      public RecurrenceRule monthly()
      Specifies that the event will repeat every month.
    • monthly

      public RecurrenceRule monthly(Integer[] days)
      Specifies that the event will repeat every month on certain days of month.
    • monthly

      public RecurrenceRule monthly(Integer[] days, int every)
      Specifies that the event will repeat every x month on certain days of month.
    • annually

      public RecurrenceRule annually()
      Specifies that the event will repeat every year.
    • monthly

      public RecurrenceRule monthly(int[] days, int[] months)
      Specifies that the event will repeat in certain months on certain days of month.
    • daily

      public RecurrenceRule daily()
      Specifies that the event will repeat daily.
    • daily

      public RecurrenceRule daily(int every)
      Specifies that the event will repeat every x days.
    • weekly

      public RecurrenceRule weekly()
      Specifies that the event will repeat every week.
    • weekly

      public RecurrenceRule weekly(DayOfWeek[] days)
      Specifies that the event will repeat on certain days every week.
    • weekly

      public RecurrenceRule weekly(DayOfWeek[] days, int every)
    • times

      public RecurrenceRule times(int times)
      How many times it will be repeated.
    • until

      public RecurrenceRule until(DateTime until)
      What the ending date of the repeat range.
    • indefinitely

      public RecurrenceRule indefinitely()
      The event will repeat indefinitely.
    • encode

      public String encode()
      Creates a string representation of the rule that can be stored in the database (DataRecurrenceField).
    • encodeExceptionModified

      public static String encodeExceptionModified(String masterId, DateTime start)
      Creates a string representation of a 'Modified' exception from the rule that can be stored in the database (DataRecurrenceField).
    • encodeExceptionDeleted

      public static String encodeExceptionDeleted(String masterId, DateTime start)
      Creates a string representation of a 'Deleted' exception from the rule that can be stored in the database (DataRecurrenceField).
    • decode

      public static RecurrenceRule decode(String input)
      Loads a rule from a string encoded using Encode() method (DataRecurrenceField).
    • ToJson

      public String ToJson()
      Serializes the rule to a JSON string that can be used to fill the UI dialog (RecurrentEventEdit.aspx). It is only able to serialize a subset of the possible rules that can be loaded by the dialog. It uses the culture of the current thread.
    • ToJson

      public String ToJson(Locale locale)
      Serializes the rule to a JSON string that can be used to fill the UI dialog (RecurrentEventEdit.aspx). It is only able to serialize a subset of the possible rules that can be loaded by the dialog. The culture used to format the DateTime values.
    • fromJson

      public static RecurrenceRule fromJson(String id, DateTime start, String json)
    • occurrences

      public List<Occurrence> occurrences(DateTime limit)
    • getRepeat

      public RepeatRule getRepeat()
    • setRepeat

      public void setRepeat(RepeatRule repeat)
    • getEvery

      public int getEvery()
    • setEvery

      public void setEvery(int every)
    • getNamed

      public List<Integer> getNamed()
    • setNamed

      public void setNamed(List<Integer> named)
    • getUnits

      public List<Integer> getUnits()
    • setUnits

      public void setUnits(List<Integer> units)
    • next

      public DateTime next(int count, DateTime last)