Set default range on initialize
Closed this issue · 5 comments
felipeecst commented
I couldn't find in the docs a way to select a default range on datepicker initialize.
Here's my configuration:
jQuery('#id").dateRangePicker({
language: 'pt'
startOfWeek: 'monday'
hoveringTooltip: false
inline:true,
container: '#container'
alwaysOpen:true
format: 'DD/MM/YYYY'
separator: ' à '
showTopbar: false
autoClose: true
endDate: moment().toDate()
}).bind('datepicker-change', (event, obj) => @emitDate(obj) )
Is there a way to set a default start and end date on initialize?
splattne commented
@felipeecst I'm also trying to force the date-picker to open with a specific date (e. g. first month of the year). Did you find a solution to this?
felipeecst commented
Unfortunately not :/
boboci9 commented
Hi, Any news about this? I am also trying to set a default start and end date? Thanks.
creatordigital-paul commented
2024... still can't do this?
monovertex commented
Setting a default value can be achieved by setting a value on the target input. Please see this example: https://jsfiddle.net/monovertex/L1e4qu7p/7/