angular / angular/components

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

Ouverte
#26,950 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area: material/datepicker feature P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### 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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par examiner l’entrée dateFilter de MatDateRangePicker et la fonctionnalité SelectionStrategy existante. Vérifiez comment l’API actuelle gère les dates de début et de fin, puis déterminez si le cas d’utilisation peut prendre en charge la sélection indépendante du lundi comme date de début et du dimanche comme date de fin, tout en rendant la date de début sélectionnée disponible pour le filtrage de la date de fin. Le travail est terminé lorsque l’UI applique les contraintes décrites sans dépendre des messages d’erreur de validation du formulaire.

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

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Fonctionnalité
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.