-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Date Picker Input Widget #2654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Date Picker Input Widget #2654
Conversation
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.
3 issues found across 25 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="frontend/src/i18n/dateLocale.ts">
<violation number="1" location="frontend/src/i18n/dateLocale.ts:27">
The localeMap misses mappings for the existing German, Italian, and Korean locales, so getDateFnsLocale() falls back to English for those users. Please add the corresponding date-fns locales (e.g., de, it, ko) to keep date formatting aligned with the translations.</violation>
</file>
<file name="backend/chainlit/input_widget.py">
<violation number="1" location="backend/chainlit/input_widget.py:380">
`datetime.fromisoformat` returns a `datetime`, which then mixes with `date` inputs (raising `TypeError` during range checks) and serializes with a time component. Use `date.fromisoformat` so the helper always returns plain dates.</violation>
</file>
<file name="frontend/src/components/ChatSettings/DatePickerInput.tsx">
<violation number="1" location="frontend/src/components/ChatSettings/DatePickerInput.tsx:27">
If an invalid ISO string is passed into the widget, new Date(...) returns an Invalid Date without throwing. That value bubbles into format(...) and toISOString(), both of which throw a RangeError, causing the picker to crash. Guard parseDate by checking isNaN(getTime()) and returning undefined when parsing fails.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
|
@Allaoua9 can you check the merge conflicts please |
use date instead of datetime Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Head branch was pushed to by a user without write access
5fe341e to
e15d4c3
Compare
|
@hayescode Done ! I've also made sure the front is sending dates instead of datetimes as this was causing undesired date shifts. |
e15d4c3 to
0107ed7
Compare
This PR is related to #2652
DatePickerwidget class with mode, min/max, placeholder, and ISO validation, exposed viaInputWidgetType.DatePickerInputcomponent (single + range) based on shadcn datepicker.getDateFnsLocaleplus placeholder strings in every translation file.react-day-picker@^9.11.1anddate-fns@^4.1.0.Single Date
Date Range :
Summary by cubic
Added a DatePicker input widget for chat settings with single and range modes, min/max bounds, date-only ISO values, and locale-aware display.
New Features
Dependencies
Written for commit cc95082. Summary will update automatically on new commits.