daysToDayOfWeek

Returns the number of days from the current day of the week to the given day of the week. If they are the same, then the result is 0.

package @safe pure nothrow @nogc
int
daysToDayOfWeek
(
DayOfWeek currDoW
,
DayOfWeek dow
)

Parameters

currDoW DayOfWeek

The current day of the week.

dow DayOfWeek

The day of the week to get the number of days to.

Examples

assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.mon) == 0);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.sun) == 6);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.wed) == 2);

Meta