def Date.of_days
import bend-kit-time@0.3.0.0/time.bend as Timeimport Base
import bend-kit-int@0.2.0.0/int.bend as Int
254# The date days after 1970-01-01, or None outside 0000-01-01 to 9999-12-31.
255def Date.of_days(days: Int.I64) -> Maybe<&2, Date>:
256 +z = Int.I64.add(days, i64(Z.EPOCH()))
257 Date.of_z.if(Bool.and(Int.I64.is_ge(z, i64(146037)), Int.I64.is_le(z, i64(3798461))),
258 Int.I64.to_u32(z))