1.1.3 • Published 6 years ago
react-omg-datetime v1.1.3
react-omg-datetime
A date and time picker in the same React.js component.
Demo
Installation
npm install --save react-omg-datetime
Usage
React.js is the only peer dependencies for react-omg-datetime. No moment.js required.
You can then use the datepicker like in the example below.
import DateTimeInput from 'react-omg-datetime'
import 'react-omg-datetime/lib/styles.css'
...
render: function() {
return <DateTimeInput value={new Date(2018, 3, 4, 2, 0, 0)}
onChange={onChange}
label={'DateTimePicker'}
// seconds
/>
}
Don't forget to add the CSS stylesheet to make it work out of the box.
API
Name | Type | Default | Description |
---|---|---|---|
value | Date | new Date() | Represents the selected date by the component. |
label | Date | null | Represents the label name by the component |
onChange | function | empty function | Callback trigger when the date changes. The callback receives the selected Date object as only parameter. |
seconds | boolean | false | When true seconds view and config will be reprenseted. |
MIT Licensed
Welcome to fork and clone.