Level 58
The issue is that the datepicker is not being initialized on the modal. To fix this, move the datepicker initialization code outside of the click event listener and into the document ready function. Also, make sure to give the input field an ID of "datepicker" so that the datepicker can be properly initialized on it. Here's the updated code:
$(document).ready(function(){
var modalContent = $('.modal-content').eq(0).html();
$('#datepicker').datepicker({
format: "mm/yyyy",
startView: "year",
minViewMode: "months"
});
$("#plan_templates").click(function() {
$('.modal').find('.modal-content').html(modalContent);
$(".modal").modal("show");
$(".tplan").click(function() {
var index = $(".tplan").index(this);
$('.modal').find('.modal-content').html($('.tab').eq(index).html());
});
});
});