Skip to content

Clearable Date Input Component#244

Merged
naasanov merged 10 commits intomainfrom
vasu/clearable-data-input-comp
Mar 28, 2026
Merged

Clearable Date Input Component#244
naasanov merged 10 commits intomainfrom
vasu/clearable-data-input-comp

Conversation

@notvasub
Copy link
Copy Markdown
Collaborator

@notvasub notvasub commented Mar 3, 2026

Add clearable date picker component for nullable date fields

Users need a way to clear nullable date fields (Hold
Expiration and Last Registered) back to null after selecting
a date. Currently, once a date is picked, there's no clear
button.

Changes:

  • Added ClearableDatePicker component that wraps Popover +
    Calendar and displays an X button when a date is selected
  • Replaced inline date picker in LocationTableForm.tsx with
    ClearableDatePicker for Hold Expiration field
  • Replaced inline date picker in StudentTableForm.tsx with
    ClearableDatePicker for Last Registered field

Closes #106

@notvasub notvasub changed the title added button Clearable Date Input Component Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Test Results Summary

464 tests  ±0   464 ✅ ±0   36s ⏱️ +6s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit f6619f0. ± Comparison against base commit 7290d03.

♻️ This comment has been updated with latest results.

@notvasub notvasub force-pushed the vasu/clearable-data-input-comp branch from 3618df0 to f363f3e Compare March 3, 2026 22:31
@notvasub notvasub requested a review from naasanov March 3, 2026 22:33
@manyuagashe manyuagashe self-requested a review March 6, 2026 16:46
@@ -0,0 +1,74 @@
"use client";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be transparent, nick was a tad bit unclear on the original ticket requirements.
He meant to say "make new component if extending the original date input component is clunky or tricky in some sense". Would it be okay for you to provide some justification as to whether this new component is necessary? If there isn't much justification, go ahead and try to refactor the PR into extensions of the old date input component. I can review the rest in more detail after the refactor if that's the path we take.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am missing something but before this PR, both StudentTableForm and LocationTableForm had the full Popover + Button + Calendar date picker pattern copy-pasted inline. There wasn't really any shared date input component to extend. Thats why I made ClearableDatePicker to extract that logic. The only real alternative would be adding the clear button logic inline to both forms separately, which would make the duplication worse. Just tryna prevent duplicated logic 😅

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Vasu sorry about that. I was sure we had an existing date picker but I see now we only have a date range picker. Thanks for calling that out. Since we're making a reusable component in this ticket, could you go ahead and replace all the places where it is duplicated with an option to make it clearable? That would help a lot to resolve some tech debt

@naasanov naasanov mentioned this pull request Mar 9, 2026
Copy link
Copy Markdown
Collaborator

@manyuagashe manyuagashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilterInput Line 137 and SplitDateRangeFilter Lines 29 and 46 still use inline date pickers. Please resolve this to your brand new component instead. no moar inline date pickers

@manyuagashe
Copy link
Copy Markdown
Collaborator

LGTM otherwise

Copy link
Copy Markdown
Collaborator

@naasanov naasanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going through all outstanding PRs. Waiting on fixes and merge conflicts on this one

Copy link
Copy Markdown
Collaborator

@naasanov naasanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

@naasanov naasanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@naasanov naasanov merged commit a3c7b16 into main Mar 28, 2026
3 checks passed
@naasanov naasanov deleted the vasu/clearable-data-input-comp branch March 28, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clearable Date Input Component

3 participants