pankaj agarwal pankaj agarwal - 3 months ago 7
jQuery Question

selected date not showing on date picker cell

We are trying to put HTML content on jquery date picker cell. We did that but its not working correctly, When we select that day, Then text box is showing NAN.

http://jsfiddle.net/cqf9d/2802/

setTimeout(function() {
$(".ui-datepicker-calendar td.Highlighted").filter(function() {
var date = $(this).text();
console.log(date);
return /\d/.test(date);
}).find("a").html($('#dataDiv').html()); // Add custom data here
// }).find("a").attr('data-custom', $('#dataDiv').html()); // Add custom data here

}, 0)


please tell what we are doing wrong.

Answer

Try this -

function addCustomInformation() {
  setTimeout(function() {
    $(".ui-datepicker-calendar td.Highlighted").filter(function() {
      var date = $(this).text();
      console.log(date);
      return /\d/.test(date);
    }).append($('#dataDiv').html()).find("a").hide(); // Add custom data here
    //   }).find("a").attr('data-custom', $('#dataDiv').html()); // Add custom data here

  }, 0)
}

JSFiddle here

Comments