I have a page with TextBox and CalendarExtender that should allow me to determine which date is selected. However, this indicates a date that is not selected.
<asp:TextBox ID="tbEffectiveDate" runat="server" CssClass="input-small" MaxLength="10" Text='<%# Bind("NewEffectiveDate", "{0:MM/dd/yyyy}") %>'> </asp:TextBox> <ajaxToolkit:CalendarExtender ID="atkEffectiveDate" runat="server" FirstDayOfWeek="Sunday" TargetControlID="tbEffectiveDate" Format="MM/dd/yyyy" OnClientDateSelectionChanged="CheckForSunday"> </ajaxToolkit:CalendarExtender>
Essentially, I'm sure the user chose Sunday, but when I select the day on the calendar, JavaScript says it's the day before. I am perplexed.
function CheckForSunday(sender, args) { var selectedDate = new Date(); selectedDate = sender.get_selectedDate();
For example, if I choose Sunday, for example, May 5:

Then in the line alert(sender.get_selectedDate()); is displayed

This says that Saturday, May 4, is chosen instead of May 5. Since in my locale we are -0700, and it shows 7 hours before midnight on the 5th, I assume this has something to do with the time zone.
Does anyone know what could be the reason for this and how to fix it so that it does not work with time and only the selected date is selected?
source share