Skip to content

viewDate function does not notify component #13

@vin-car

Description

@vin-car

Calling viewDate function with a valid moment object as argument does not notify changes to the view. Something like $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') ); has no effect on the datetimepicker.

Live example on this question on Stack Overflow using jQuery 2.1.1, moment 2.22.2, bootstrap 4.1.3 and tempus dominus 5.1.2.


I think that the issue is the _notifyEvent function that always returns without trigger event since:

if ((e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate))

is always true when this._viewUpdate() is called from viewDate function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions