// HTML
// only month and year
<input name="month" id="datMonthYearFrom" />
// All
<input name="month1" id="datMonthYearTo" />
// JS
$(function () {
$("#datMonthYearFrom").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: "MM yy",
onClose: function (dateText, inst) {
$(this).datepicker('setDate',
new Date(inst.selectedYear, inst.selectedMonth,
1));
}
}).focus(function () {
var thisCalendar = $(this);
$('.ui-datepicker-calendar').detach();
});
////////////////////////////////////////// Second
$("#datMonthYearTo").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: "MM yy",
onClose: function
(dateText, inst) {
$(this).datepicker('setDate',
new Date(inst.selectedYear, inst.selectedMonth,
1));
}
});
});
No comments:
Post a Comment