![New Socket Web Extension, Take Socket with You](https://cdn.sanity.io/images/cgdhsj6q/production/7c7e90f37af51d175eaf8b2ae56124aec35c57c8-874x566.png?w=400&fit=max&auto=format)
Product
New Socket Web Extension, Take Socket with You
Can you spot malicious malicious packages on the web at a glance? Socket can. Check out our updated Web Extension!
material-ui-datetimepicker-forked
Advanced tools
Wrapper above material ui date and time pickers
Readme
Wrapper for Material UI Time and Date picker component
Component, that joins Material UI`s pickers into the one component, one input and 2 dialogs, appearing one by one.
We are recommending to use your custom wrapper outside of this component to store your custom props, and not pass Dialogs each time you use this package, because it should be solved in one of next material-ui versions
Here is a quick example to get you started, it's all you need:
npm install material-ui-datetimepicker
import React from 'react';
import DateTimePicker from 'material-ui-datetimepicker';
import DatePickerDialog from 'material-ui/DatePicker/DatePickerDialog'
import TimePickerDialog from 'material-ui/TimePicker/TimePickerDialog';
class Demo extends React.Component {
state = {
dateTime: null
}
setDate = (dateTime) => this.setState({ dateTime })
render() {
return (
<DateTimePicker
onChange={this.setDate}
DatePicker={DatePickerDialog}
TimePicker={TimePickerDialog}
/>
);
}
}
Note that each of this props applied by default
import DatePickerDialog from 'material-ui/DatePicker/DatePickerDialog';
import TimePickerDialog from 'material-ui/TimePicker/TimePickerDialog';
<DateTimePicker
value={new Date()} // picker value moment/string/number/js Date
format='MMM DD, YYYY hh:mm A'
timePickerDelay={150}
returnMomentDate={false} // if true will return moment object
className='datetime-container'
textFieldClassName='datetime-input'
name='picker' // form value name
datePickerMode='portrait' // or landscape
openToYearSelection={false}
disableYearSelection={false}
hideCalendarDate={false}
firstDayOfWeek={1}
minutesStep={1}
showCurrentDateByDefault={false}
clearIcon={<ClearIcon />} // set null to not render nothing
// available callbacks
onChange={() => {}}
onTimePickerShow={() => {}}
onDatePickerShow={() => {}}
onDateSelected={() => {}}
onTimeSelected={() => {}}
shouldDisableDate={() => {}}
DatePicker={DatePickerDialog}
TimePicker={TimePickerDialog}
// styles
clearIconStyle={{ }}
textFieldStyle={{ }}
style={{ }} // root
timePickerBodyStyle={{ }}
/>
You can apply any of material ui Text Field props to the root.
<DateTimePicker
floatingLabelFixed
floatingLabelText="Get my date"
floatingLabelFocusStyle={{ marginTop: '10px' }}
disabled={false}
errorText='Required'
id="some-id"
fullWidth={false}
/>
For information about how to contribute, see the CONTRIBUTING file.
The project is licensed under the terms of MIT license
FAQs
Wrapper above material ui date and time pickers
We found that material-ui-datetimepicker-forked demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Can you spot malicious malicious packages on the web at a glance? Socket can. Check out our updated Web Extension!
Product
Socket introduces three new customizable default security policies for users to choose from: Low Noise (traditional SCA), Default, and Higher Noise.
Security News
MITRE has just minted its 400th CNA, as the NVD struggles to tame its backlog of CVEs awaiting analysis, which has increased by 30% since June.