[DatePicker] wrong week days when using `formatDate`
See original GitHub issueWith error:
const dateTimeFormat = new Intl.DateTimeFormat('en-AU');
<DatePicker DateTimeFormat={() => dateTimeFormat} formatDate={dateTimeFormat.format} locale="en-AU" />
Without error
<DatePicker />
I think the component is using the formatDate
method everywhere and that’s causing the error
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
[DatePicker] wrong week days when using formatDate #4052
Your DatePicker looks weird. What version of MUI are you using? Could you update it and try. I tried reproducing your issue, had...
Read more >jQuery UI DatePicker - return wrong Date Format
Solution #2 (Recommended): ... I split the date_text string using split(".") and now have an array with day in from[0], month in from[1]...
Read more >Issues with Date Picker / Date Formats
Solved: Hello Community, I'm having some problems getting my dates to display / submit correctly using a Datepicker linked to a SharePoint List....
Read more >jQuery UI Datepicker
Specify either an actual date via a Date object or as a string in the current dateFormat , or a number of days...
Read more >jquery ui datepicker showing wrong date — DataTables forums
I want to use the jquery UI datepicker in this case as it is more customizable.(I only want the user to select month/year...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try using this: let DateTimeFormat = global.Intl.DateTimeFormat;
<DatePicker hintText=“en-AU locale” DateTimeFormat={DateTimeFormat} locale=“en-AU” formatDate={new DateTimeFormat(‘en-AU’, { day: ‘numeric’, month: ‘numeric’, year: ‘numeric’, }).format} firstDayOfWeek={0} />
and let me know.
I think the issue is because I’m not passing the DateTimeFormat constructor, I’m passing the created object (
DateTimeFormat={() => aussieFormat}
).using this works: