Datepicker middle navigation button disabled for minDate Month

Aperta
#1,494 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia con il componente Datepicker e la sua funzione isDateInRange(), quindi riproduci il comportamento nella story Datepicker di Flowbite Storybook. Il lavoro è completato quando il pulsante dell’header consente di spostarsi a un mese contenente minDate o maxDate, anche quando entrambi i limiti rientrano nello stesso mese.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Steps to reproduce

  1. Go to the Datepicker component and set minDate={new Date()} as the current date. The maxDate can be any date in the following month.
  2. If your minDate is set to any day other than the first of the month, when you switch to the month view, the month containing your minDate will be disabled.

The issue seems to stem from the isDateInRange() function, which considers newDate as the first day of the month. This function should be split into two: one for days and another for months, years, and decades. While the current function works fine for day selection, it should be slightly modified for months, years, and decades to allow navigation and selection even if minDate or maxDate falls within the same month.

Current behavior

When minDate is set to any day other than the first of the month, the month button is disabled when navigating back to that month.

Expected behavior

The header button should allow navigation to the month containing the minDate.

Context

The desired functionality is to enable navigation to the month where minDate is set, even if it isn't the first of the month. Additionally, if both minDate and maxDate are within the same month, the button should still allow navigation to that month. Currently, when using the change view button, the month becomes disabled, and the user is forced to shift to the next month if maxDate is in the future.

Here is a short video of me on Flowbite Storybook's Datepicker story, showing the issue when trying to click the button with no response:

https://github.com/user-attachments/assets/08e3e153-24bc-4853-a35d-5503c392045d

Lingua principale
TypeScript
Stelle
2.2k
Fork
504
Merge medio
19h 16m
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di themesberg/flowbite-react

Tutte le issue di themesberg/flowbite-react

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.