月份和年份不会从datepicker jquery更改 [英] month and year is not changing from datepicker jquery

查看:63
本文介绍了月份和年份不会从datepicker jquery更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友,,,



月份和年份不变...



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>

推荐答案

(。date ).datepicker({
showOn:'focus',
showOtherMonths:true,
selectOtherMonths:true,
flat:true,
mode:'multiple',
日历: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){
(".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(
(this).val(


.datepicker.formatDate('dd / m / yy',new date(year,month,1) );
},
onClose:function(dateText,inst){
var month =
.datepicker.formatDate('dd/m/yy', new Date(year, month , 1))); }, onClose: function(dateText, inst) { var month =


这篇关于月份和年份不会从datepicker jquery更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆