uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.66k stars 6.06k forks source link

Could not set startDate and endDate when format="yyyy" and minViewMode="2" (years) #1140

Open chuanconggao opened 9 years ago

chuanconggao commented 9 years ago

How to set startDate and endDate when format="yyyy" and minViewMode="2" (years)?

jogaco commented 9 years ago

Does not seem to work. Just tried in the online demo:

http://eternicode.github.io/bootstrap-datepicker/?markup=component&format=yyyy&weekStart=&startDate=1900&endDate=2015&startView=2&minViewMode=2&todayBtn=false&clearBtn=false&language=en&orientation=auto&multidate=&multidateSeparator=&keyboardNavigation=on&forceParse=on#sandbox

+1

jogaco commented 9 years ago

Got it: startDate: -50y endDate: +1y The documentation is not very clear about this. Got it by source code inspection.

acrobat commented 9 years ago

@jogaco Do you maybe want to submit a PR to fix the docs to be more clear? Otherwise please open a seperate issue with some suggestions on how to fix the unclear docs!

chuanconggao commented 9 years ago

@jogaco Thanks for showing how to specify the past 50 years. But I want to specify an absolute year like 1980, do I have to convert it to relative form like -35y? Is there a better way?

@acrobat I tried and for month and day I can specify an absolute value like 01/2014 or 01/01/2014, but 2014 does not work. This should be a bug, right?

acrobat commented 9 years ago

@chuanconggao yes it looks like the month/year or year input is buggy indeed!