S
Sand
I have a monthCalender that I want users to be able to
select a range of dates (or a single date) then calculate
a value based on the number of days that person has
selected. The values are higher for the weekends so I
need to be able to figure out how many of the selected
days are weekdays versus weekends.
I already have code to tell me the number of days the
person has selected. I also understand how to get the
DayOfWeek. I tried to code an nested if statement that
would check the dayofweek, see how far away from the
weekend it is and then check that against the number of
days the user selected but it has become unwieldly and,
well, pretty crazy looking.
I'm hoping that someone can tell me a simpler coding
method. My other thought was maybe it's possible
something to do with the SelectedRange? I thought maybe
there is a way to loop through selected range to see if
dayofweek for each weekend day fell inside that range but
I really don't know how I would do that (if it's even
possible)especially since dayofweek gives an integer while
selectedrange gives dates.
Oy!
Any help would be greatly appreciated.
Thank you.
select a range of dates (or a single date) then calculate
a value based on the number of days that person has
selected. The values are higher for the weekends so I
need to be able to figure out how many of the selected
days are weekdays versus weekends.
I already have code to tell me the number of days the
person has selected. I also understand how to get the
DayOfWeek. I tried to code an nested if statement that
would check the dayofweek, see how far away from the
weekend it is and then check that against the number of
days the user selected but it has become unwieldly and,
well, pretty crazy looking.
I'm hoping that someone can tell me a simpler coding
method. My other thought was maybe it's possible
something to do with the SelectedRange? I thought maybe
there is a way to loop through selected range to see if
dayofweek for each weekend day fell inside that range but
I really don't know how I would do that (if it's even
possible)especially since dayofweek gives an integer while
selectedrange gives dates.
Oy!
Any help would be greatly appreciated.
Thank you.