简体   繁体   English

是否可以在引导日期选择器中自定义年份范围

[英]Is it possible to customize the years range in bootstrap date picker

I have a attribute name is assessment year,in that attribute if i choose the year(ex 2012),the bootstrap date picker display the 2012 calendar only 我的属性名称是评估年,在该属性中,如果我选择年份(例如2012年),则启动日期选择器仅显示2012年日历

my js file 我的js文件

 $('.datepicker').datepicker({ format: "dd/mm/yyyy", todayHighlight: true, todayBtn: 'linked', autoclose: true }); 

I searched the lot of things,still i am not get a correct answer...help me friends 我搜索了很多东西,但仍然没有得到正确的答案...帮助我的朋友们

simple just add startDate and endDate assuming that you selected year "2016" http://jsfiddle.net/LcqM7/542/ 只需假设您选择年份为“ 2016”即可添加startDate和endDate http://jsfiddle.net/LcqM7/542/

$('.datepicker').datepicker({
    autoclose: true,
    startDate: '01/01/2016',
    endDate: '12/31/2016'
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM