Skip to content

[BUG] Datepicker - manually change day in input #6263

Closed

Description

@datcuemil

Bug, feature request, or proposal:

The input and the datepicker communicate incorrectly. If I select a date from the picker, it will be displayed DD/MM/YYYY.
Following this logic, if I try to manually modify the DD, when I open the datepicker, and if I set a value from 1-12, the corresponding month will be selected in the picker.

What is the expected behavior?

If the output date format of the datepicker is of format DD/MM/YYY, when I manually modify the day (DD) that day should be selected in the picker.

What is the current behavior?

If I modify the day, it modifies the month in the background.

What are the steps to reproduce?

Go to: https://material.angular.io/components/datepicker/overview

Select from datepicker 10 august 2017. It will display 10/08/2017 (DD/MM/YYYY).
Open the datepicker again, it will display october as selected month.

I'll reopen this thread until someone actually tries to replicate the bug and fixes it.

What is the use-case or motivation for changing an existing behavior?

Because is illogic and stupid how the component updates and behaves.

Activity

  1. julianobrasil commented on Aug 4, 2017

    @julianobrasil
    Contributor

    It's not a bug. You need to build a custom date adapter: https://plnkr.co/edit/jc4Ywu?p=preview

    See the docs overview at the bottom, the "Internationalization" title.

  2. mmalerba commented on Aug 9, 2017

    @mmalerba
    Contributor

    @julianobrasil is correct. Once the new Angular i18n API is available we will be able to improve the NativeDateAdapter to handle this case better (#6030), but currently you'll need to create a custom DateAdapter

  3. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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