DayOfWeek represents a day of the week in the Gregorian calendar.
time = Time.local(2016, 2, 15) time.day_of_week # => Time::DayOfWeek::Monday
Each member is identified by its ordinal number starting from Monday = 1 according to ISO 8601.
#value returns this ordinal number. It can easily be converted to the also common numbering based on Sunday = 0 using value % 7.
1 2 3 4 5 6 7 Returns the day of week that has the given value, or raises if no such member exists.
Returns true if this enum value equals Friday
Returns true if this enum value equals Monday
Returns true if this enum value equals Saturday
Returns true if this enum value equals Sunday
Returns true if this enum value equals Thursday
Returns true if this enum value equals Tuesday
Returns true if this enum value equals Wednesday
Enum
Enum
Enum
Enum
Comparable(Enum)
Value
Object
Object
Object
© 2012–2026 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.19.0/Time/DayOfWeek.html