Skip to content

End of Life Ruby 3.2 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) → true or false

Returns true if the arguments define a valid commercial date, false otherwise:

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

See Date.commercial.

See argument start.

Related: Date.jd, Date.commercial.

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