How to use @material-ui/pickers - 5 common examples

To help you get started, we’ve selected a few @material-ui/pickers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mui-org / material-ui-pickers / docs / pages / guides / StaticComponents.example.jsx View on Github external
function StaticPickers() {
  const [value, handleDateChange] = useState(new Date());

  // you can past mostly all available props, like minDate, maxDate, autoOk and so on
  const { pickerProps, wrapperProps } = useStaticState({
    value,
    onChange: handleDateChange,
  });

  return (
    <>
      <div>
        
          
        

        <button>
          Clear date ({value &amp;&amp; value.toJSON()})
        </button>
      </div>
github nginformatica / flipper-ui / dist / core / DateTime.js View on Github external
var renderDatePicker = function renderDatePicker() {
    return _react["default"].createElement(_pickers.KeyboardDatePicker, fieldProps);
  };
github nginformatica / flipper-ui / dist / core / DateTime.js View on Github external
var renderDateTimePicker = function renderDateTimePicker() {
    return _react["default"].createElement(_pickers.KeyboardDateTimePicker, fieldProps);
  };
github nginformatica / flipper-ui / dist / core / DateTime.js View on Github external
var renderTimePicker = function renderTimePicker() {
    return _react["default"].createElement(_pickers.KeyboardTimePicker, fieldProps);
  };
github nginformatica / flipper-ui / dist / core / DateTime.js View on Github external
}, otherProps.InputProps)
  });

  var renderDatePicker = function renderDatePicker() {
    return _react["default"].createElement(_pickers.KeyboardDatePicker, fieldProps);
  };

  var renderTimePicker = function renderTimePicker() {
    return _react["default"].createElement(_pickers.KeyboardTimePicker, fieldProps);
  };

  var renderDateTimePicker = function renderDateTimePicker() {
    return _react["default"].createElement(_pickers.KeyboardDateTimePicker, fieldProps);
  };

  return _react["default"].createElement(_pickers.MuiPickersUtilsProvider, {
    utils: _dateFns["default"],
    locale: LOCALES[locale]
  }, type === 'date' && renderDatePicker(), type === 'time' && renderTimePicker(), type === 'datetime' && renderDateTimePicker());
};

@material-ui/pickers

React components, that implements material design pickers for material-ui v4

MIT
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis