vascofg / react-admin-date-inputs

Date Inputs for react-admin
MIT License
67 stars 81 forks source link

Utils as property #9

Closed ai-matulis closed 5 years ago

ai-matulis commented 5 years ago
@@ -23,9 +23,10 @@
         isRequired,
         className,
         meta,
+        utils,
       } = this.props;

       const { touched, error } = meta;

       return (
         <div className="picker">
@@ -26,10 +27,10 @@
       } = this.props;

       const { touched, error } = meta;

       return (
         <div className="picker">
-          <MuiPickersUtilsProvider utils={DateFnsUtils} locale={locale}>
+          <MuiPickersUtilsProvider utils={utils} locale={locale}>
             <PickerComponent
               {...options}
               label={<FieldTitle
@@ -62,6 +63,7 @@
     labelTime: PropTypes.string,
     className: PropTypes.string,
     locale: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
+    utils: PropTypes.func,
   };

   _makePicker.defaultProps = {
@@ -75,6 +77,7 @@
     labelTime: '',
     className: '',
     locale: undefined,
+    utils: DateFnsUtils,
   };
   return _makePicker;
 };
vascofg commented 5 years ago

Implemented in react-admin-date-inputs@1.0.18