Datepicker onSelect not working
I have the function below that doesn't seem to work and could do with a little help please. The function basically adds 30 days to the date selected with the datepicker.
$('#datepicker').datepicker({
onSelect: function(dateText, inst) {
var date = new Date(dateText);
date.setDate(date.getDate() + 30);
date.format('mm/dd/yy');
alert(date)
}
});
I cant see where I am going wrong. When a date is selected 开发者_JAVA百科it is adding a empty anchor to the address bar URL, if is helps.
Thanks.
The problem is that date.format('mm/dd/yyy')
is blowing up.
Examples of how to format a date in js here:
http://www.webdevelopersnotes.com/tips/html/10_ways_to_format_time_and_date_using_javascript.php3
精彩评论