Skip to content

A date and time picker in the same React.js component with Material design style.

License

Notifications You must be signed in to change notification settings

Tim1023/react-omg-datetime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

Welcome to fork and clone.

About

A date and time picker in the same React.js component with Material design style.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published