Some countries use the Daylight saving time (DST) /summer time/ which is the practice of advancing or adjusting backward clocks one hour near the start of a temperate mid-season (spring or autumn). Unfortunately, this adjusting is error-prone to software components and leads to unwanted behavior when using a RadDatePicker.
For instance, let’s assume that you have a web site for renting out various halls or principal rooms for meetings and social affairs, and you use a RadDatePicker to schedule the event date. I am a user from Brazil and with meu amor decided our wedding date to be on October the 20th. However, every time I select this date, the picker re-selects it to be the 19th. I contact you, the web administrator, and ask you “Does destiny want to prevent me from making a big mistake or is this a bug? What is happening, amigo?”
Here is the explanation:
Most probably, I have a Brazilian culture set on my computer:
11 Answers, 1 is accepted
I am having the same kind of problem. in java script i am assigning 1/1/1900 to variable if the datepicker left blank while sending the value to server. but at server end i am getting the value as 2/1/1900 (i.e. next day of 1/1/1900) and the datepicker works perfectly if any date has been selected.
Please let me know if any ideas on this.
Thanks in advance,
We are not aware of such issue and it would be best if you could provide your code declaration and the related code behind in order to investigate the issue locally. Could you please explain how exactly you are setting the default date if the date input is empty?
Thank you for your reply,
Below is the code i am using for assigning the default value
var FromDate = $find("<%= datepickerfrom.ClientID %>").get_selectedDate() == null ? new Date(1900, 1, 1).format("MM/dd/yyyy") : $find("<%= datepickerfrom.ClientID %>").get_selectedDate().format("MM/dd/yyyy");
this solution works in that version?
var FromDate = $find("<%= datepickerfrom.ClientID %>").get_selectedDate() == null ? new Date(1900, 0, 1).format("MM/dd/yyyy") : $find("<%= datepickerfrom.ClientID %>").get_selectedDate().format("MM/dd/yyyy");
I am getting correct date if selected and 1/1/1900 if the datepicker is empty.
Could you please elaborate a little bit more on your scenario? Sending us your code declaration and the related code behind will help us to pinpoint the reason for that behavior.
Thanks for the feedback.
The problem occurs when DST is active. In my case the DST is for Brazil.
The change to daylight savings time occurred on October 20, then select in the calendar the Datepicker this day he goes to the 19th of October.
adding one hour to date.
The problem now is when we make one click on the input field, it seems that the control keeps a hidden field with the date and time 00:00:00 reverts to the same behavior.
The product version is 2008.3.1125.35
The behavior which you described is expected and for this case you have to use the workaround from the first post. As far as I can see you didn't try it, so could you please check it out and let me know about the result after you test it?
I had tried before posting the problem here in the forum .. but without success ...
the result is the same .. select the day October 20, 2013 and the calendar selects the 19th.
The only solution I found was to override the JS adding your selected day an hour .. however now found another problem ..
When I put a MaxDate type today .. and try to select that day he invalidate ..
because as I added one hour the day selected is greater than the MaxDate ..
The MaxDate the codebehind does not allow to set the hours?
In this case you could try the following approach :