@@ -299,7 +299,7 @@ class DateRangePicker extends Picker {
299299 return date ? ( date instanceof Date ? date : new Date ( date ) ) : null
300300 }
301301
302- _createInput ( placeholder , value ) {
302+ _createInput ( name , placeholder , value ) {
303303 const inputEl = document . createElement ( 'input' )
304304 inputEl . classList . add ( 'form-control' )
305305 inputEl . disabled = this . _config . disabled
@@ -308,6 +308,10 @@ class DateRangePicker extends Picker {
308308 inputEl . type = 'text'
309309 inputEl . value = value
310310
311+ if ( this . _element . id ) {
312+ inputEl . name = `${ name } -${ this . _element . id } `
313+ }
314+
311315 return inputEl
312316 }
313317
@@ -319,8 +323,8 @@ class DateRangePicker extends Picker {
319323 inputGroupEl . classList . add ( `input-group-${ this . _config . size } ` )
320324 }
321325
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 ) )
324328
325329 const inputGroupTextSeparatorEl = document . createElement ( 'span' )
326330 inputGroupTextSeparatorEl . classList . add ( 'input-group-text' )
0 commit comments