DateOfWeekday function works as intended