I have a calendar where I only allow the user to select one day. Here's the code I have for that.
The only problem with this is, if they have a date selected, and click that same date. I.e. 12/18/2012 is selected and they click 12/18/2012 again, it deselects that date so not date is selected. Is there a way I can make it keep that 12/18 selected if they click it and it's already been selected?
Dim
selDate
If
(e.SelectedDates.Count <> 0)
Then
selDate = e.SelectedDates(e.SelectedDates.Count - 1).
Date
calDay.SelectedDate = selDate
litDaySpec.Text = clsData.displayReservationsForADay(calDay.SelectedDate)
Dim
dateDate
As
New
DateTime(calDay.SelectedDate.Year, calDay.SelectedDate.Month, calDay.SelectedDate.Day, 12, 0, 0)
If
getDST(calDay.SelectedDate)
Then
'If (TimeZone.CurrentTimeZone.IsDaylightSavingTime(dateDate)) Then
lblTime.Text =
"6:00"
Else
lblTime.Text =
"5:00"
End
If
Else
The only problem with this is, if they have a date selected, and click that same date. I.e. 12/18/2012 is selected and they click 12/18/2012 again, it deselects that date so not date is selected. Is there a way I can make it keep that 12/18 selected if they click it and it's already been selected?