You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users of mui date pickers use the wrong type when defining their locale because most of the adapters require a string, but date-fns is expecting an object: mui/mui-x#4598
I propose to add a verification in every constructor such that in development environment then library throw an explicit error message if the type passed is not correct:
constructor({
locale,
formats,}: {formats?: Partial<DateIOFormats>;locale?: Locale}={}){if(process.env.NODE_ENV!=='production'){if(locale&&typeoflocale==='string'){throwError(`date-fns expect \`locale\` to be an object, get a ${typeoflocale}`)}}this.locale=locale;this.formats=Object.assign({},defaultFormats,formats);}
If it sounds good, I can write the PR
The text was updated successfully, but these errors were encountered:
Users of mui date pickers use the wrong type when defining their locale because most of the adapters require a string, but
date-fns
is expecting an object:mui/mui-x#4598
I propose to add a verification in every constructor such that in development environment then library throw an explicit error message if the type passed is not correct:
If it sounds good, I can write the PR
The text was updated successfully, but these errors were encountered: