Click here to Skip to main content
15,893,790 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI friends,,,

month and year is not changing ..

<script type="text/javascript">

  $(".date").datepicker({ 
	showOn: 'focus',
    showOtherMonths: true,
    selectOtherMonths: true,
    flat:true,
	mode: 'multiple',
	calendars: 1,	
	changeMonth: true,
    changeYear: true,
	yearRange: '1900:2023',
    dateFormat: "dd/m/yy",
	showButtonPanel: true,
    currentText: "",
	showButtonPanel:true,
    currentText: "This Month",
    onChangeMonthYear: function (year, month, inst) {     
        $(this).val($.datepicker.formatDate('dd/m/yy', new Date(year, month , 1))); 
    },
    onClose: function(dateText, inst) {
        var month = $(".ui-datepicker-month :selected").val();
        var year = $(".ui-datepicker-year :selected").val();
		var date = $(".ui-datepicker-date :selected").val();
      //  $(this).val($.datepicker.formatDate('dd/m/yy', new Date(year,month, 1)));
    }  
}).focus(function () {
    $(".ui-datepicker-calendar").show();
	$(".ui-datepicker-date").show();
}).after(
    $("<a href='java<!-- no -->script: void(0);'>clear</a>").click(function() {
        $(this).prev().val('');
    })
);



</script>
Posted

1 solution

Reffer following:




<title>jQuery UI Datepicker - Default functionality






$(function () {
$(".date").datepicker({
showOn: 'focus',
showOtherMonths: true,
selectOtherMonths: true,
flat: true,
mode: 'multiple',
calendars: 1,
changeMonth: true,
changeYear: true,
yearRange: '1900:2023',
dateFormat: "dd/m/yy",
showButtonPanel: true,
currentText: "",
showButtonPanel: true,
currentText: "This Month",
onChangeMonthYear: function (year, month, inst) {
$(this).val($.datepicker.formatDate('dd/m/yy', new Date(year, month, 1)));
},
onClose: function (dateText, inst) {
var month = $(".ui-datepicker-month :selected").val();
var year = $(".ui-datepicker-year :selected").val();
var date = $(".ui-datepicker-date :selected").val();
// $(this).val($.datepicker.formatDate('dd/m/yy', new Date(year,month, 1)));
}
}).focus(function () {
$(".ui-datepicker-calendar").show();
$(".ui-datepicker-date").show();
}).after(
$("clear").click(function () {
$(this).prev().val('');
})
);
});




Date:


 
Share this answer
 
Comments
PRAKASH_N 17-Oct-13 3:25am    
not working
kumaragurupathi 17-Oct-13 4:49am    
tell what is ur correct need???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900