@@ -299,7 +299,7 @@ class DateRangePicker extends Picker {
299
299
return date ? ( date instanceof Date ? date : new Date ( date ) ) : null
300
300
}
301
301
302
- _createInput ( placeholder , value ) {
302
+ _createInput ( name , placeholder , value ) {
303
303
const inputEl = document . createElement ( 'input' )
304
304
inputEl . classList . add ( 'form-control' )
305
305
inputEl . disabled = this . _config . disabled
@@ -308,6 +308,10 @@ class DateRangePicker extends Picker {
308
308
inputEl . type = 'text'
309
309
inputEl . value = value
310
310
311
+ if ( this . _element . id ) {
312
+ inputEl . name = `${ name } -${ this . _element . id } `
313
+ }
314
+
311
315
return inputEl
312
316
}
313
317
@@ -319,8 +323,8 @@ class DateRangePicker extends Picker {
319
323
inputGroupEl . classList . add ( `input-group-${ this . _config . size } ` )
320
324
}
321
325
322
- const startInputEl = this . _createInput ( this . _getPlaceholder ( ) [ 0 ] , this . _setInputValue ( this . _startDate ) )
323
- const endInputEl = this . _createInput ( this . _getPlaceholder ( ) [ 1 ] , this . _setInputValue ( this . _endDate ) )
326
+ const startInputEl = this . _createInput ( this . _config . range ? 'start-date' : 'date' , this . _getPlaceholder ( ) [ 0 ] , this . _setInputValue ( this . _startDate ) )
327
+ const endInputEl = this . _createInput ( 'end-date' , this . _getPlaceholder ( ) [ 1 ] , this . _setInputValue ( this . _endDate ) )
324
328
325
329
const inputGroupTextSeparatorEl = document . createElement ( 'span' )
326
330
inputGroupTextSeparatorEl . classList . add ( 'input-group-text' )
0 commit comments