Datepicker middle navigation button disabled for minDate Month

Abierto
#1,494 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Comienza con el componente Datepicker y su función isDateInRange(), y luego reproduce el comportamiento en la historia de Datepicker de Flowbite Storybook. Se considera terminado cuando el botón del encabezado permite navegar a un mes que contiene minDate o maxDate, incluso cuando ambos límites están dentro del mismo mes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

  • 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

Lenguaje dominante
TypeScript
Estrellas
2.2k
Forks
504
Merge medio
19 h 16 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de themesberg/flowbite-react

Todos los issues de themesberg/flowbite-react

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.