angular / angular/components

feat(MatDateRangePicker): dateFilter for start and end dates independently.

Đang mở
#26,950 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/datepicker feature P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### Feature Description

We have the `dateFilter` input, but this is limited to forcing you to use the same filter for the start range and end range. I'd like to see `startDateFilter` and `endDateFilter` inputs so that I can provide a filter for the start of the range and the end of the range independently. It doesn't have to be this exact solution, so as long as the use-case below can be met.

I think that the `endDateFilter` should also have an argument for the "start date" that the user selected so that you can programmatically define which end date(s) are acceptable for the start date the user selected if that is a necessary constraint.

### Use Case

Our use-case is to require the user to select a date that falls on any Monday then require the user to select any date after Monday so as long as it falls on a Sunday.

I don't see any way to require the user to do this without form validation rules (I'd like this to facilitated by the UI instead of through validation error messages).

The only thing that comes close, is the `SelectionStrategy` functionality, but it doesn't seem suitable for a variable number of weeks.

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

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

Hướng nghiên cứu

Bắt đầu bằng cách xem xét đầu vào dateFilter của MatDateRangePicker và chức năng SelectionStrategy hiện có. Kiểm tra cách API hiện tại xử lý ngày bắt đầu và ngày kết thúc, sau đó xác định liệu trường hợp sử dụng này có thể hỗ trợ việc chọn độc lập thứ Hai làm ngày bắt đầu và Chủ nhật làm ngày kết thúc, đồng thời cung cấp ngày bắt đầu đã chọn cho việc lọc ngày kết thúc hay không. Công việc được xem là hoàn tất khi UI thực thi các ràng buộc đã mô tả mà không dựa vào thông báo lỗi xác thực biểu mẫu.

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
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 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.