jQuery UI Datepicker后退按钮跳转到1899 [英] jquery ui datepicker back button jumps to 1899

查看:72
本文介绍了jQuery UI Datepicker后退按钮跳转到1899的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须缺少某些设置或某些设置,但是当我使用后退按钮时,日期选择器将从当年跳至1899.

I must be missing some setting or something, but when I use the back button the datepicker jumps to 1899 from the current year.

还有其他人看到并解决了这个问题吗?

Has anyone else seen this and fixed it?

(您可以看到我已注释掉的不同组合.)

(You can see the different combos I've commented out.)

    $('.dialog-search,#from')
   .datepicker({
    defaultDate: 'c-1m',
    dateFormat: 'yymmdd',
    //changeMonth: true,
    changeYear: true,
    showAnim: 'fadeIn',
    duration: 200,
    //gotoCurrent: true, 
    showOtherMonths: true,
    selectOtherMonths: true,
    currentText: 'Now',
    shortYearCutoff: '+20',
    //showWeek: true,
    //firstDay: 1,
    numberOfMonths: 1,
    showButtonPanel: true,
    yearRange: 'c-200:c',
    onSelect: function(selectedDate,inst) {
     $('.dialog-search,#from').val(selectedDate);
    }
   });

推荐答案

当我有多个具有相同ID的文本输入时出现了此问题,当您在同一模型的页面上有多个编辑器时,使用MVC框架很容易做到这一点班级.我通过显式指定Id并保留Name来解决它,以便模型解析可以在回发时进行.

I had this issue when I had multiple text inputs with the same ID, which is easy to do with MVC frameworks when you have multiple editors on page for same model class. I resolved it by explicitly specifying Id and leaving Name as is, so that model resolving works on postback.

这篇关于jQuery UI Datepicker后退按钮跳转到1899的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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