tempusdominus / bootstrap-4

Tempus Dominus Bootstrap 4 Datetime Picker
https://getdatepicker.com/5-4/
MIT License
611 stars 239 forks source link

Using clear() function on datetimepicker element #303

Open Dror1966 opened 4 years ago

Dror1966 commented 4 years ago

I clean date element with this command

$('#txtStartDate').data('datetimepicker').clear();

When I tried to use it again it rais an errors

Unhandled exception at line 7, column 19304 in https://localhost/appname/Scripts/plugins/datetimePicker/tempusdominus-bootstrap-4.min.js 0x800a138f - JavaScript runtime error: Unable to get property 'clone' of undefined or null reference

Unhandled exception at line 7, column 7253 in https://localhost/appname/Scripts/plugins/datetimePicker/tempusdominus-bootstrap-4.min.js 0x800a138f - JavaScript runtime error: Unable to get property 'isSame' of undefined or null reference

on the following command

this._notifyEvent({type:f.Event.HIDE,date:this._getLastPickedDate().clone()

SudoerWithAnOpinion commented 4 years ago

Function calls are done via .datetimepicker('FUNCTION_NAME')

$('#txtStartDate-start').datetimepicker('clear');