[pickers] DateTimeRangePicker
throws error with format
prop in MUI X Pro v7.11.0
#14600
Labels
bug 🐛
Something doesn't work
component: DateTimeRangePicker
The React component
component: pickers
This is the name of the generic UI component, not the React module!
good first issue
Great for first contributions. Enable to learn the contribution process.
status: waiting for author
Issue with insufficient information
Steps to Reproduce
@mui/x-date-pickers-pro
version 7.11.0.DateTimeRangePicker
component with aformat
prop, as shown below:Current behavior
Problem: The format prop causes the DateTimeRangePicker component to throw two unclear errors when the user clicks on the calendar.
Expected behavior
The format prop should work as described in the documentation and allow customization of the date format without causing runtime errors.
Context
Context:
I'm working on a project using MUI X Pro components, specifically the DateTimeRangePicker, integrated with a React and Material-UI-based form. The form uses react-hook-form for validation, and Day.js for date handling.
Summary of the Problem:
Problem: The format prop on the DateTimeRangePicker causes an error when the user clicks on the calendar.
Current Impact: Unable to customize the date format as needed.
Expected Behavior: The format prop should work as described in the documentation and allow customization of the date format without runtime errors.
Solution Sought:
I'd like to request the MUI X team to investigate whether this is a bug in how the format prop is handled or if there's missing configuration that needs to be documented.
Implementation Details:
Frontend Framework: React (v18.0.0)
Date Library: Day.js
MUI Components: @mui/material v5.15.19, @mui/x-date-pickers-pro v7.11.0
Form Management: React Hook Form
Picker Setup: DateTimeRangePicker wrapped inside LocalizationProvider using the AdapterDayjs.
Here’s the snippet causing the issue:
Current Workaround: Removing the format prop resolves the error, but I need to customize the date format as per design requirements.
Your environment
Environment
@mui/x-date-pickers-pro
version: 7.11.0@mui/material
version: 5.15.19Search keywords: DateTimeRangePicker
The text was updated successfully, but these errors were encountered: