NativeScript / NativeScript/plugins
[@nativescript/datetimepicker] Form with date field in Angular
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 206
- Fork
- 123
- Merge medio
- 2g 1h
- PR unite (30g)
- 1
Descrizione
Hello,
I use formGroup to do my forms in my app so I used to define my form fields with formControlName like this :
<TextField formControlName="kilometers" keyboardType="number"></TextField>
But when I put it with the datePickerField, my date variable to set the current date doesn't work anymore and it puts 1 january 1970 and when I click on the field 1 january 1900.
As soon as I remove my formControlName value, it works without any issue, like if there was a conflict between date and formControlName :
<DatePickerField #date formControlName="date" [date]="dateRefuel" [pickerTitle]="'Refuel.DateTitle' | L" [maxDate]="dateRefuel"></DatePickerField>
Do you have any idea how to fix this ? The only solution that I found is to put the #date and extract the value when I click on my send form button.
Thanks
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’esempio DatePickerField Angular formControlName nell’issue e confronta il suo comportamento con quello dello stesso campo senza formControlName. Riproduci il binding della data corrente e le interazioni con il picker; il lavoro è completato quando la data non diventa più il 1° gennaio 1970 o 1900 e rimane utilizzabile nel form.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend, mobile
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100