1.1.3 • Published 6 years ago

react-omg-datetime v1.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

react-omg-datetime

A date and time picker in the same React.js component.

npm version

Demo

Show Case

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

NameTypeDefaultDescription
valueDatenew Date()Represents the selected date by the component.
labelDatenullRepresents the label name by the component
onChangefunctionempty functionCallback trigger when the date changes. The callback receives the selected Date object as only parameter.
secondsbooleanfalseWhen true seconds view and config will be reprenseted.

MIT Licensed

Welcome to fork and clone.

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago