Skip to content
This repository was archived by the owner on Jun 22, 2018. It is now read-only.
This repository was archived by the owner on Jun 22, 2018. It is now read-only.

Uncaught TypeError: Cannot read property 'getTime' of undefined #26

@shishtpal

Description

@shishtpal

I am using this only as Time picker with format HH:ii P but when I dynamically change its value it throws this error

bootstrap-datetimepicker.min.js:formatted:431 Uncaught TypeError: Cannot read property 'getTime' of undefined
    at getDate (bootstrap-datetimepicker.min.js:formatted:431)
    at g.update (bootstrap-datetimepicker.min.js:formatted:624)
    at g.setStartDate (bootstrap-datetimepicker.min.js:formatted:497)
    at new g (bootstrap-datetimepicker.min.js:formatted:315)
    at HTMLInputElement.<anonymous> (bootstrap-datetimepicker.min.js:formatted:1432)
    at Function.each (jquery-2.1.3.min.js:2)
    at n.fn.init.each (jquery-2.1.3.min.js:2)
    at n.fn.init.d.fn.datetimepicker (bootstrap-datetimepicker.min.js:formatted:1427)
    at <anonymous>:1:3
getDate @ bootstrap-datetimepicker.min.js:formatted:431
update @ bootstrap-datetimepicker.min.js:formatted:624
setStartDate @ bootstrap-datetimepicker.min.js:formatted:497
g @ bootstrap-datetimepicker.min.js:formatted:315
(anonymous) @ bootstrap-datetimepicker.min.js:formatted:1432
each @ jquery-2.1.3.min.js:2
each @ jquery-2.1.3.min.js:2
d.fn.datetimepicker @ bootstrap-datetimepicker.min.js:formatted:1427
(anonymous) @ VM4937:1
Show 2 more blackboxed frames

When I inspected the error I found that this.date is undefined, Which is returned by getUTCDate Method

...
        getDate: function() {
            var i = this.getUTCDate();
            if (i === null) {
                return null
            }
            return new Date(i.getTime() + (i.getTimezoneOffset() * 60000))
        },
        getUTCDate: function() {
            return this.date
        },
...

Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions