Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
WebDatePicker set_value not putting in correct value
posted

I have a WebDatePicker on my page. In the client side, I need to set the value. I have the following code in place which I call by sending in the ID of the date picker and the value I want it set to:

function setOpenerDate(id, value)
{
    var dt= new Date(value);
    var datepicker= window.opener.$find(id);
    alert('value=' + datepicker.get_value());
    datepicker.set_value(dt);
    alert('value=' + datepicker.get_value());
}

The value I'm sending in for testing is "5/9/2013". I've verified that the grabbing of the WebDatePicker is successful. As you can see, I have two alerts. The first one comes back "value=null" (which is expected, since I never set the value while building the page). But, the second one always comes back "value=Thu Jun 05 2014 00:00:00 GMT-0500 (Central Standard Time)" (it happens to be the 5th right now, so I'm assuming it is just getting set as the current date). I also previously had an alert to show me the value of "dt", which comes back as "value=Thu May 09 2013 00:00:00 GMT-0500 (Central Standard Time)", so I know the date is being set properly. Can you see what could be going wrong here? Thanks!

We are on version 13.2.20132.2028 and using .NET Framework 4.5.