当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Limit Year Range

问题描述:

Actually I am working on an HRM System, and am using a Year Picker, I want to limit it to a year from 1900 to current year.The code I am using is below

 $('#txtinitialYear').datepicker({ yearRange: "1900:c" });

({

viewMode: 'years',

minViewMode: 'years',

autoclose: true,

format: 'yyyy',

});

</script>

网友答案:

Try This Code:-

$(".datepicker").datepicker({
    viewMode: 'years',
    minViewMode: 'years',
    autoclose: true,
    format: 'yyyy',
    yearRange: "-100:+0", // last hundred years
});
分享给朋友:
您可能感兴趣的文章:
随机阅读: