0.5.1 • Published 5 years ago

react-moment-datetime v0.5.1

Weekly downloads
24
License
MIT
Repository
github
Last release
5 years ago

react-moment-datetime

Build Status Coverage Status

React datetime picker powered by momentjs. See the demo here.

Usage

<DateTimeInput
  value={this.state.date}
  onChange={this.onChange}
  showTime={true}
/>

Available properties:

PropertyTypeContentDefault Value
i18nJSONEntries to render i18n contentSee below for an example
showTimebooleanTrue to display a separate input field for the timetrue
valueDateThe current valueundefined
isValidfunctionA function that receives a date and returns true if the date is valid input. Can be used to set a maximum or minimum value in the calendar(moment) => true
onChangefunctionA function that will receive the value when the user introduces a valid date. Receives a JSON of name, value and strValueundefined

The default value of i18n:

{
  Date: 'Date',
  Time: 'Time',
  Close: 'Close',
  Hours: 'Hours',
  Minutes: 'Minutes',

  // date format
  format: 'YYYY-MM-DD',

  // locale ISO
  locale: 'en'
}

Check app.js for a working example.

Development

Work on the code:

npm install
npm run build
npm run watch
xdg-open http://localhost:8080/example/

Work on the demo:

./publish.sh

License and acknowledgements

Licensed under the MIT license

react-moment-datetime is based on the great job by Wang Zuo, the author of input-moment

Design inspired in https://dribbble.com/shots/1439965-Due-Date-and-Time-Picker.

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.6

6 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.0

7 years ago