def tz.event.new
bend-kit-time@0.3.0.0 · time.bend:1087
import bend-kit-time@0.3.0.0/time.bend as Time
import Base
import bend-kit-int@0.2.0.0/int.bend as Int
1087def tz.event.new(+now: Int.I64, old: Maybe<&2, TzEvent>, +when: Int.I64, dst: Bool) -> Maybe<&2, TzEvent>:
1088 match old:
1089 case None{}:
1090 tz.event.select(Int.I64.is_le(when, now), None{}, when, dst)
1091 case Some{TzEvent{+prev, flag}}:
1092 tz.event.select(Bool.and(Int.I64.is_le(when, now), Int.I64.is_gt(when, prev)),
1093 Some{TzEvent{prev, flag}}, when, dst)