bootstrap-datetimepicker icon indicating copy to clipboard operation
bootstrap-datetimepicker copied to clipboard

If is anything else in the date field i get "TypeError: d is undefined"

Open yomisimie opened this issue 7 years ago • 1 comments

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: image

yomisimie avatar Jul 24 '17 17:07 yomisimie

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

carlotodeschini avatar Aug 21 '17 21:08 carlotodeschini