A cyclical time value stores an absolute chronon count but means a position
within its cycle (e.g. day_of_week() means a weekday, not a particular
Wednesday). Comparison therefore reduces both operands to their position
within the cycle - the same reduction format() displays - and compares
those:
day_of_week(date("2020-01-15")) == day_of_week(date("2020-01-22"))isTRUE, since both are a Wednesday.day_of_year(date("2020-01-15")) == day_of_year(date("2021-01-15"))isTRUE, since both are the 15th day of their year.
Both operands must share a cycle: a cycle is a modulus rather than a unit,
so there is no meaningful common cycle between (say) a weekday and a
day-of-year, and comparing them is an error. Differing chronons within a
shared cycle are reconciled as they are for mt_linear:
both positions are expressed in the finest common chronon, and a discrete
value spans the closed interval of its chronon, so
a == biffstart(a) == start(b)andend(a) == end(b)a < biffend(a) < start(b),a > biffstart(a) > end(b)a <= biffend(a) <= end(b),a >= biffstart(a) >= start(b)
As for mt_linear, this is not a total order when chronons differ. Ordering
follows the position within the cycle (so Mon < Wed); the cycle's wrap-around
is not treated as circular.
Usage
# S4 method for class 'mt_cyclical'
e1 == e2
# S4 method for class 'mt_cyclical'
e1 != e2
# S4 method for class 'mt_cyclical'
e1 < e2
# S4 method for class 'mt_cyclical'
e1 <= e2
# S4 method for class 'mt_cyclical'
e1 > e2
# S4 method for class 'mt_cyclical'
e1 >= e2