DefaultTrigger

object DefaultTrigger extends Trigger

Generate the next date-time that matches a calendar event and is closest but after a give reference date-time.

This is done as follows: The reference date is divided into its components, like day, month, year, hour, minute and second. For each component, starting from the least significant one, a value matching the corresponding calendar event component is chosen. For example, if the reference minute is 16 and the minute component is 0/10, the closest possible value is 20.

There are three possible outcomes for each decision (stop after first result):

  1. the current value matches as is 2. there is one greater than the current value 3. use the first possible value (which is lower than current)

If the result is 1) go to the next component. If the result is 2) the date has moved into the future. Then all previous results must be set to the first possible value, in order to get the closest date. If the result is 3) the next component may only check for 2) and 3). If the result 3) carries through to the year component, the year must be set to the next value. If that is not possible, there is no date-time and a `None' is returned.

trait Trigger
class Object
trait Matchable
class Any

Type members

Classlikes

case class Calc(flag: Flag, date: DateTime, pos: Pos, ce: CalEvent)
Companion
object
object Calc
Companion
class
case class Date(year: Int, month: Int, day: Int)
Companion
object
object Date
Companion
class
case class DateTime(date: Date, time: Time)
Companion
object
object DateTime
Companion
class
sealed trait Flag
Companion
object
object Flag
Companion
class
case class Time(hour: Int, minute: Int, second: Int)
Companion
object
object Time
Companion
class

Value members

Concrete methods

def next(ref: ZonedDateTime, ev: CalEvent): Option[ZonedDateTime]

Inherited methods

def nextRepeat(count: Int)(ref: ZonedDateTime, ev: CalEvent): List[ZonedDateTime]
Inherited from
Trigger