enum Time::DayOfWeek

Overview

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.

Defined in:

t_cal/time.cr

Instance Method Summary

Instance Method Detail

def sunday_value : Int32 #

Returns the index of this day where 1 is Sunday and 7 is Saturday.


[View source]