Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v3.2.13) is shown here.
days_to_week_start(start_day = :monday)
public
Returns number of days to start of this week. Week is assumed to start on
start_day, default is :monday.
# File activesupport/lib/active_support/core_ext/date/calculations.rb, line 179
def days_to_week_start(start_day = :monday)
start_day_number = DAYS_INTO_WEEK[start_day]
current_day_number = wday != 0 ? wday - 1 : 6
(current_day_number - start_day_number) % 7
end