angular / angular/components

valid dd/mm format switch sides after manual input on datepicker field

Ouverte
#11,936 18 commentaires 11 réactions 0 personnes assignées Voir sur GitHub
area: material/datepicker P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
That the valid `dd/mm/yyyy` inputed date remains as it is, not matter what, they always switch sides on change.

#### What is the current behavior?
E.g.: `03/02/1990` becomes `02/03/1990`.

#### What are the steps to reproduce?
Set a custom locale like Brasil:

```typescript
// location
import localePt from '@angular/common/locales/pt';
import localePtExtra from '@angular/common/locales/extra/pt';

registerLocaleData(localePt, 'pt', localePtExtra);
```

Then try to use the datepicker with manual input.

#### What is the use-case or motivation for changing an existing behavior?
Because it works very well with the Angular locale config, there's just this switch bug that does not work properly.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
```json
{
"@angular/core": "^6.0.6",
"@angular/material": "^6.3.0",
}
```

#### Is there anything else we should know?

##### UI input:

![image](https://user-images.githubusercontent.com/3942006/41925531-3ab16044-7943-11e8-884c-3b591f537b8e.png)

##### Manual input:
![image](https://user-images.githubusercontent.com/3942006/41925561-4f8d566c-7943-11e8-8a73-e2d76a0659b1.png)

~I really don't wanna use moment.js~

----

It seems like the StackBlitz example isn't wroking as well: https://stackblitz.com/angular/vnvbdjykmve?file=app%2Fdatepicker-locale-example.ts

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’exemple StackBlitz lié dans app/datepicker-locale-example.ts et reproduisez le comportement de saisie manuelle du datepicker après avoir enregistré la locale pt et les données de locale supplémentaires. Suivez l’analyse syntaxique dépendante de la locale du datepicker et la gestion des changements ; le travail est terminé lorsqu’une valeur saisie telle que 03/02/1990 reste identique après la modification du champ.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend, internationalization
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.