Datepicker middle navigation button disabled for minDate Month

オープン
#1,494 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

まず Datepicker コンポーネントとその isDateInRange() 関数から始め、次に Flowbite Storybook の Datepicker story でその動作を再現します。完了条件は、両方の境界値が同じ月に含まれる場合も含め、header ボタンで minDate または maxDate を含む月へ移動できることです。

索引モデルが issue の本文から書いたものです。

説明

  • 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

主要言語
TypeScript
スター
2.2k
フォーク
504
平均マージ
19時間 16分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

themesberg/flowbite-react のほかの issue

themesberg/flowbite-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。