NativeScript / NativeScript/plugins

[@nativescript/datetimepicker] Form with date field in Angular

Đang mở
#136 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
206
Fork
123
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với ví dụ DatePickerField Angular formControlName trong issue và so sánh hành vi của nó với cùng trường đó khi không có formControlName. Tái hiện việc binding ngày hiện tại và các tương tác với picker; hoàn tất khi ngày không còn trở thành ngày 1 tháng 1 năm 1970 hoặc 1900 mà vẫn có thể sử dụng trong form.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend, mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.