-
Notifications
You must be signed in to change notification settings - Fork 6
MODUL-1106: Modifier l'affichage de la vue mois du datepicker #1057
Conversation
… des mois dans le calendrier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super, l'animation fait une belle job aussi !
Quand on voudra faire sélectionner une année, on ajoutera une props pour permettre d'afficher la vue mois / année à l'ouverture.
Cette fonctionnalité fonctionne déjà en utilisant la prop |
Super, j'avais pas vu que tu l'avais déjà codé 👍 Pour le initial-view=YEARS-MONTHS, ce serait bien de faire scrroller la liste d'années pour afficher l'année sélectionnée par défaut par le composant à l'ouverture et éviter de tomber sur la première année de l'intervalle. On va se servir de ça surtout pour choisir une date de naissance, donc le range sera genre de 1900 à 2000. Qu'est-ce que tu en penses ? Un détail aussi, mais je mettre le rond gris sur le mois courant (comme le jour d'aujourd'hui) car même si le mois est sélectionné par défaut je trouve que ce serait plus logique de dit, voici le mois courant, mais tu ne l'as pas encore sélectionné. C'est un détail ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voir commentaire il faudra au minimun
- utiliser les InternalCleaveOptions
- ajouter immediate: true
|
||
const parts: string[] = DATE_FORMAT_REGEX.exec(value) as string[]; | ||
if (!parts || parts.length < 4) { | ||
if (!DATE_FORMAT_REGEX.test(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On devrait peut être utiliser Date.parse() ici au lieu de faire tout la poutine a bras avec un regex qui introduit une certaine complexité et possiblement des bug (car généralement une regex = 4 bugs )
Par example, dans date-format on fait :
!isNaN(Date.parse(control.value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lorsque je mets isNaN(Date.parse(control.value)
plusieurs tests unitaires plantent.
ModulDate › initialization › from a string › of a supported format › then a date with format '18/1/1' is a date comparable with date '2018-01-01'
ModulDate › initialization › from a string › of a supported format › then a date with format '18/1/18' is a date comparable with date '2018-01-18'
A single date state › when calling event (from abstract class) › month events › month-select › when selecting a month after the maximum date, the current month will be set to the maximum
A range date state › when calling event (from abstract class) › month events › month-select › when selecting a month after the maximum date, the current month will be set to the maximum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, je suis d'accord que ça sort du scope de cette PR mais on peut garder ça en tête si modul-date nous cause des problèmes
@ulaval/modul-components
PR Checklist
Nouveau visuel de la vue mois du m-datepicker qui remplacera la vue année et la vue mois actuel.
Lien vers le prototype Adobe XD
https://xd.adobe.com/view/f47f37a4-17bf-4d2c-7e78-f0067b3cd839-824e/
https://jira.dti.ulaval.ca/browse/MODUL-1106