chainlit
chainlit copied to clipboard
Date Picker Input Widget
trafficstars
This PR is related to https://github.com/Chainlit/chainlit/issues/2652
- Backend: new
DatePickerwidget class with mode, min/max, placeholder, and ISO validation, exposed viaInputWidgetType. - Frontend:
DatePickerInputcomponent (single + range) based on shadcn datepicker. - i18n: locale-aware formatting via
getDateFnsLocaleplus placeholder strings in every translation file. - Dependencies: add
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, ISO-safe values, and locale-aware display.
-
New Features
- Backend: DatePicker widget with mode, initial/min/max, format, placeholder, ISO parsing/validation, and InputWidgetType "datepicker".
- Frontend: DatePickerInput (single and range) with calendar UI, confirm/reset for ranges, disabled days from bounds, and integration in FormInput.
- i18n: locale mapping via date-fns and placeholders across all translations.
-
Dependencies
- Added react-day-picker ^9.11.1 and date-fns ^4.1.0.
Written for commit 5fe341e14cf4021dc3a8f0ac1ce4a5ccda5060bc. Summary will update automatically on new commits.