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.

Datepicker doesn't parse manually edited input value using defined format #1107

Closed
@Buthrakaur

Description

@Buthrakaur

I'm using datepicker-popup attribute to set date format according to angular $locale service, which depends on browser language settings in my case. The read-only part of the problem works quite nice. The problem is there's no support for date parsing according to this format when user manually sets date in the input field instead of using datepicker popup. The problem is probably on this line:
https://github.com/angular-ui/bootstrap/blob/master/src/datepicker/datepicker.js#L348 - the value is parsed just using new Date(viewValue) instead of using the format defined in datepicker-popup attribute.

I'd happily fix this issue and make a PR, but I don't know about any easy possibility to parse date value using a format string in JS without using any external library. Any ideas?

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