Skip to content

Invalid display of date with modelType of type String #22

@nicolasgarnil

Description

@nicolasgarnil

The date is being parsed with the display format instead of the model type format.

Have a look at the following plunker. The first input ("Date 1") should display "01/09/2016" instead of "09/01/2016". The second input ("Date 2") is displayed correctly because moment interpretes it as an invalid format and it fallbacks to the modelType format, which is accepted.

In order to fix this, modelType must precede attrs.dateTimeInput in the inputFormats construction. If I do this, all specs pass, including this special case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions