jalali datepicker在1397年显示月亮的问题(jalali)

时间:2019-02-24 12:08:14

标签: javascript datepicker jalali-calendar

在1397年选择月份时,只能选择5月

$( "#<%= renderResponse.getNamespace() %>fromDate").datepicker({ 
    dateFormat: 'yy/mm/dd', 
    changeMonth: true,
    changeYear: true,
    showButtonPanel: true,
    maxDate: new Date(),
    beforeShow: function (input, inst) {
        var rect = input.getBoundingClientRect();
        setTimeout(function () {
            var offset = $(input).offset();
            inst.dpDiv.css({ top: offset.top, left: offset.left });
        }, 0);
    },
    onSelect: function(dateText, inst) {

        $('#<%= renderResponse.getNamespace() %>toDate').datepicker('option', 'minDate', new JalaliDate(inst['selectedYear'], inst['selectedMonth'], inst['selectedDay']));
    }
});

$( "#<%= renderResponse.getNamespace() %>toDate").datepicker({ 
    dateFormat: 'yy/mm/dd', 
    changeMonth: true,
    changeYear: true,
    showButtonPanel: true,
    maxDate: new Date(),
    beforeShow: function (input, inst) {
        var rect = input.getBoundingClientRect();
        setTimeout(function () {
            var offset = $(input).offset();
            inst.dpDiv.css({ top: offset.top, left: offset.left });
        }, 0);
    },
    onSelect: function(dateText, inst) {
        $("#<%= renderResponse.getNamespace() %>fromDate").datepicker('option', 'maxDate', new JalaliDate(inst['selectedYear'], inst['selectedMonth'], inst['selectedDay']));

    }
});

0 个答案:

没有答案