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.
Enum
Enum
Enum
Comparable(Enum)
Value
Object
Object
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/Time/DayOfWeek.html