DatePicker [ eyecon ] set a range of date jquery/javascript
-
01-07-2021 - |
Question
I am using multi month Datepicker
i am unable set a date range explicitly.
for eg i have to show sep 1st 2012 to 30 aug 2012 as selected on some button click.
documentation has this method but it only select the start date
$('selector').DatePickerSetDate(date, shiftTo);
Thanks in advance.
Solution
Found answer after going through plug-in code
$("selector").DatePickerSetDate([new Date(2012,8,1), new Date(2012,9,30)],1)
OTHER TIPS
Try this
$('input').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',
yearRange: '1920:'
});
hope it can help
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow