bootstrap-datetimepicker
bootstrap-datetimepicker copied to clipboard
If is anything else in the date field i get "TypeError: d is undefined"
I have identified where this come from: https://github.com/smalot/bootstrap-datetimepicker/blob/master/js/bootstrap-datetimepicker.js#L449
You only check if the d
is not null
but in my case is undefined
and the function continues. I have the date format set but my field has an hour in it prefilled from php:
I found a workaround. Change line 451 in "bootstrap-datetimepicker.js" file from:
if (d === null) {
to:
if (d === null || d === undefined) {
Hope this help, Carlo