org.saddle.time

RRule

case class RRule(freq: Frequency, interval: Int, wkst: Option[Weekday], count: Option[Int], until: Option[DateTime], bysetpos: List[Int], bymonth: List[Int], bymonthday: List[Int], byyearday: List[Int], byweekno: List[Int], byday: List[WeekdayNum], byhour: List[Int], byminute: List[Int], bysecond: List[Int], inzone: DateTimeZone, joins: List[(RRule, Option[DateTime])], excepts: List[(RRule, Option[DateTime])]) extends Product with Serializable

Wrapper of a RFC 2445 RRULE or EXRULE as implemented in the google rfc2445 java library.

For _lots_ of examples of recurrence rule constructions, see the following: http://recurrance.sourceforge.net/

To create, start by invoking RRule(frequency), e.g.

RRule(DAILY)

Use setters to construct the rule you want. For instance:

val rule = RRule(DAILY) byWeekDay(TU, TH) withCount(3)

Finally, attach a start date as follows, to get a DateTime iterator:

val iter = rule from datetime(2007,1,1)

By default, the times created will be in LOCAL time; however, you may attach a different time zone (eg, UTC).

Also, you may join rules or add exceptions via the join and except functions. Eg,

val rules = RRule(DAILY) byWeekDay(TU, TH) join { RRule(DAILY) byWeekDay(MO) } val dates = rules from datetime(2006,12,31) take(5) toList

Please note:

Some of the javadoc descriptions of RFC2445 fields are courtesy of python dateutil 2.1: -- http://labix.org/python-dateutil -- https://pypi.python.org/pypi/python-dateutil

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. RRule
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def byHour(h: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the hours valid in the recurrence.

  8. def byMinute(m: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the minutes valid in the recurrence.

  9. def byMonth(m: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the months valid in the recurrence.

  10. def byMonthDay(d: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the month days valid in the recurrence.

  11. def bySecond(s: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the minutes valid in the recurrence.

  12. def bySetPos(i: Int*): RRule

    The bySetPos specifies a value or list of values which correspond to the nth occurrence(s) within the set of events specified by the rule.

    The bySetPos specifies a value or list of values which correspond to the nth occurrence(s) within the set of events specified by the rule. Valid values are +/-1 to +/-366. It MUST be used in conjunction with another BYxxx rule, and is used to restrict the occurrences valid within the rule.

  13. def byWeekDay[T](d: T*)(implicit conv: (T) ⇒ WeekdayNum): RRule

    If given, it must be either a Weekday (eg MO), a or a sequence of these constants.

    If given, it must be either a Weekday (eg MO), a or a sequence of these constants. When given, these variables will define the weekdays valid in the recurrence. It's also possible to use an argument n for the weekday instances, which will signify the nth occurrence of this weekday in the period. For example, with MONTHLY, or with YEARLY and BYMONTH, using FR(+1) in byweekday will specify the first friday of the month where the recurrence happens. Notice that in the RFC documentation, this is specified as BYDAY, but was renamed to avoid the ambiguity of that keyword.

  14. def byWeekNo(w: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the week numbers valid in the recurrence.

    If given, it must be either an integer, or a sequence of integers, meaning the week numbers valid in the recurrence. Week numbers have the meaning described in ISO8601, that is, the first week of the year is that containing at least four days of the new year.

  15. def byYearDay(d: Int*): RRule

    If given, it must be either an integer, or a sequence of integers, meaning the year days valid in the recurrence.

  16. val byday: List[WeekdayNum]

  17. val byhour: List[Int]

  18. val byminute: List[Int]

  19. val bymonth: List[Int]

  20. val bymonthday: List[Int]

  21. val bysecond: List[Int]

  22. val bysetpos: List[Int]

  23. val byweekno: List[Int]

  24. val byyearday: List[Int]

  25. def canEqual(arg0: Any): Boolean

    Definition Classes
    RRule → Equals
  26. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. val count: Option[Int]

  28. def counting(i: Int): AnyRef { def from(dt: org.joda.time.DateTime): org.joda.time.DateTime }

    Syntactic sugar to get the nth occurrence; allows user to write, e.

    Syntactic sugar to get the nth occurrence; allows user to write, e.g.

    val x = weeklyOn(FR) counting 3 from datetime(2013, 1, 1)

    to get the third Friday in January 2013. With a negative number, e.g.

    val x = weeklyOn(FR) counting -3 from datetime(2013, 1, 1)

    you would get the third occurrence counting back from Jan 1, 2013.

    Note that in both cases, if the 'from' date conforms to the recurrence rule, it will be counted.

  29. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. def equals(arg0: Any): Boolean

    Definition Classes
    RRule → Equals → AnyRef → Any
  31. def except(rrule: RRule, from: Option[DateTime] = None): RRule

    Exclude another RRule, and optionally specify a start date.

    Exclude another RRule, and optionally specify a start date. If a start date is not specified, it will utilize the start date provided when the function 'from' is applied.

  32. val excepts: List[(RRule, Option[DateTime])]

  33. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. val freq: Frequency

  35. def from(dt: DateTime): Iterator[DateTime]

    Generate an iterator of DateTime instances based on the current RRule instance starting on or after the provided DateTime instance.

  36. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  37. def hashCode(): Int

    Definition Classes
    RRule → AnyRef → Any
  38. def inZone(tz: DateTimeZone): RRule

    If given, it determines which time zone the recurrence date/times will be generated in.

  39. val interval: Int

  40. val inzone: DateTimeZone

  41. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  42. def join(rrule: RRule, from: Option[DateTime] = None): RRule

    Join with another RRule, and optionally specify a start date.

    Join with another RRule, and optionally specify a start date. If a start date is not specified, it will utilize the start date provided when the function 'from' is applied.

  43. val joins: List[(RRule, Option[DateTime])]

  44. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  45. final def notify(): Unit

    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  47. def productArity: Int

    Definition Classes
    RRule → Product
  48. def productElement(arg0: Int): Any

    Definition Classes
    RRule → Product
  49. def productIterator: Iterator[Any]

    Definition Classes
    Product
  50. def productPrefix: String

    Definition Classes
    RRule → Product
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  52. def toICal: RRule

    Attributes
    protected[time]
  53. def toString(): String

    Definition Classes
    RRule → AnyRef → Any
  54. val until: Option[DateTime]

  55. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  56. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  57. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  58. def withCount(c: Int): RRule

    How many occurrences will be generated.

  59. def withInterval(i: Int): RRule

    The interval between each freq iteration.

    The interval between each freq iteration. For example, when using YEARLY, an interval of 2 means once every two years, but with HOURLY, it means once every two hours. The default interval is 1.

  60. def withUntil(d: DateTime): RRule

    A datetime instance that will specify the limit of the recurrence.

  61. def withWkSt(w: Weekday): RRule

    The week start day.

    The week start day. Must be one of the MO, TU, ... constants specifying the first day of the week. This will affect recurrences based on weekly periods.

  62. val wkst: Option[Weekday]

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any