Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
QuestionC# Classes in DLL files Pin
Cozmo232-May-08 5:49
Cozmo232-May-08 5:49 
AnswerRe: C# Classes in DLL files Pin
Judah Gabriel Himango2-May-08 6:30
sponsorJudah Gabriel Himango2-May-08 6:30 
AnswerRe: C# Classes in DLL files Pin
Abhijit Jana2-May-08 6:30
professionalAbhijit Jana2-May-08 6:30 
AnswerRe: C# Classes in DLL files Pin
#realJSOP2-May-08 6:30
mve#realJSOP2-May-08 6:30 
AnswerRe: C# Classes in DLL files Pin
Cozmo232-May-08 7:49
Cozmo232-May-08 7:49 
GeneralRe: C# Classes in DLL files Pin
Jason McBurney2-May-08 9:22
Jason McBurney2-May-08 9:22 
GeneralRe: C# Classes in DLL files Pin
Cozmo235-May-08 3:12
Cozmo235-May-08 3:12 
QuestionDateTime, DayOfWeek in range comparison Pin
buchstaben2-May-08 4:11
buchstaben2-May-08 4:11 
Hello,

I'm stuck with the following issue:
let's say there is a DateTime 'timepoint', wich is passed in my method. I need to check now, whether timepoint's DayOfWeek is between 'fromDayOfWeek' and 'toDayOfWeek'.

that's what I've done so far:

protected override bool checkTimepoint(DateTime timepoint, DayOfWeek from, DayOfWeek to)
        {
            bool retValue;

            retValue = timepoint.DayOfWeek >= from && timepoint.DayOfWeek <= to;

            return retValue;
        }


This will work for ranges like Monday-Friday, Thursday-Wednesday, Wednesday-Wednesday, but it will fail for something like Saturday-Sunday, since Sunday (0) is lower than Saturday(6).

Any idea on how to logically implement this issue?

Thanks in advance.
AnswerRe: DateTime, DayOfWeek in range comparison Pin
Urs Enzler2-May-08 4:22
Urs Enzler2-May-08 4:22 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
buchstaben2-May-08 4:28
buchstaben2-May-08 4:28 
QuestionRe: DateTime, DayOfWeek in range comparison Pin
Spacix One2-May-08 4:54
Spacix One2-May-08 4:54 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
buchstaben2-May-08 5:19
buchstaben2-May-08 5:19 
AnswerRe: DateTime, DayOfWeek in range comparison [modified] Pin
#realJSOP2-May-08 6:35
mve#realJSOP2-May-08 6:35 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 7:39
mvePIEBALDconsult2-May-08 7:39 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 7:45
mve#realJSOP2-May-08 7:45 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 8:15
mve#realJSOP2-May-08 8:15 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 8:46
mvePIEBALDconsult2-May-08 8:46 
AnswerRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 7:28
mvePIEBALDconsult2-May-08 7:28 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 7:43
mve#realJSOP2-May-08 7:43 
AnswerRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 8:10
mve#realJSOP2-May-08 8:10 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 9:13
mvePIEBALDconsult2-May-08 9:13 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 18:55
mvePIEBALDconsult2-May-08 18:55 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP3-May-08 0:26
mve#realJSOP3-May-08 0:26 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult3-May-08 5:09
mvePIEBALDconsult3-May-08 5:09 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP4-May-08 4:02
mve#realJSOP4-May-08 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.