Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Date.valid_commercial?

Date.valid_commercial?(cwyear, cweek, cwday[, start=Date::ITALY]) → bool

Returns true if the given week date is valid, and false if not.

Example
Date.valid_commercial?(2001,5,6)  #=> true
Date.valid_commercial?(2001,5,8)  #=> false

See also ::jd and ::commercial.

See also .valid_civil? .valid_date? .today .valid_jd? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1