The defaultDate option needs to be provided in the current dateFormat, i.e. '17-10-2017'.
BTW, line 6 does nothing since you've already initialised the datepicker. You should remove the datepicker code from lines 3 and 5 and just keep line 6.
You should combine the options from lines 7 and 12 and 16 into a single call.