Thursday, 8 August 2013

Datepicker For Bootstrap : update value

Datepicker For Bootstrap : update value

I am currently using Datepicker for Bootsrap and am trying to dynamically
change its value after attaching it.
I have initialized it this way :
$("#VH_chooseWeek").datepicker({
weekStart : 1
})
.on('changeDate', function(ev){
VH_displayWeek(ev.date);
$("#VH_chooseWeek").datepicker('hide');
VH_main();
});
And trying to update it this way :
var VH_tamperWeek = function(nbWeek){
currentToday.setDate(currentToday.getDate() + 7*nbWeek);
$("VH_chooseWeek").datepicker('setValue', currentToday);
}
No exception is raised but it seems the 'setValue' method isn't working.
Do you have some kind of idea to fix the problem or a workaround that
could do it ?

No comments:

Post a Comment