Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Problem with datepicker dateFormat #2061

Closed
@HannesHentzschel

Description

@HannesHentzschel

It seems the datepicker is not consistently using the dateFilter to parse the entered dates.

See the following Plunkr:
http://plnkr.co/edit/MLbIplS5L8tQdZy597GJ?p=preview
Its the documentation example except that I changed the dateformat to 'dd.MM.yyyy'.
Now when you change the entered date by changing the textfield using the keyboard the datepicker looses track of the date value. It becomes undefined in the $moduleValue. You can also see that the entered date is not highlighted in the calendar widget.

The reason to me seems to be the use of new Date(stringValue) to parse the date:
https://github.com/angular-ui/bootstrap/blob/master/src/datepicker/datepicker.js#L503

I think is should use the dateFilter like it is done here:
https://github.com/angular-ui/bootstrap/blob/master/src/datepicker/datepicker.js#L540

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