def Date.days_in_month

bend-kit-time@0.3.0.0 · time.bend:192

import bend-kit-time@0.3.0.0/time.bend as Time
import Base

192# 0 for a month outside 1 to 12.
193def Date.days_in_month(+y: U32, +m: U32) -> U32:
194  Bool.pick(U32, U32.is_eq(m, 2), Bool.pick(U32, Date.is_leap(y), 29, 28),
195    Bool.pick(U32, Bool.and(U32.is_ge(m, 1), U32.is_le(m, 12)),
196      (30 + ((m + (m >> 3n)) .&. 1) : U32), 0))

Uses (10)

Used by (2)