Created
May 20, 2010 22:26
-
-
Save brianc/408198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static int GetDayNumber(DayOfWeek dayOfWeek) | |
{ | |
switch (dayOfWeek) | |
{ | |
case DayOfWeek.Monday: | |
return 1; | |
case DayOfWeek.Tuesday: | |
return 2; | |
case DayOfWeek.Wednesday: | |
return 3; | |
case DayOfWeek.Thursday: | |
return 4; | |
case DayOfWeek.Friday: | |
return 5; | |
case DayOfWeek.Saturday: | |
return 6; | |
case DayOfWeek.Sunday: | |
return 7; | |
} | |
throw new InvalidOperationException("Another day was added to the week. Life as we know it has ended."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment