Skip to content

LKay/react-bootstrap-datetimepicker

This branch is 33 commits ahead of, 5 commits behind quri/react-bootstrap-datetimepicker:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6b2bf13 · Mar 24, 2016
Mar 24, 2016
Mar 24, 2016
Mar 24, 2016
Feb 16, 2016
Dec 11, 2015
Dec 8, 2015
Jul 12, 2015
Dec 10, 2015
Dec 12, 2015
Jan 20, 2015
May 1, 2014
Jan 25, 2016
Dec 11, 2015
Nov 12, 2015
Jul 13, 2015
Jul 12, 2015
Mar 24, 2016
Jan 14, 2016

Repository files navigation

npm CircleCI Codecov

react-bootstrap-datetimepicker

This project is a port of https://github.com/Eonasdan/bootstrap-datetimepicker for React.js

Usage

Installation :

npm install react-bootstrap-datetimepicker

Then

var DateTimeField = require('react-bootstrap-datetimepicker');

...

render: function() {
  return <DateTimeField />;
}

See Examples for more details.

API

DateTimeField

Name Type Default Description
dateTime string moment().format('x') Represents the inital dateTime, this string is then parsed by moment.js
format string "x" Defines the format moment.js should use to parse and output the date to onChange
inputFormat string "MM/DD/YY h:mm A" Defines the way the date is represented in the HTML input. It must be a format understanable by moment.js
onChange function x => console.log(x) Callback trigger when the date changes. x is the new datetime value.
showToday boolean true Highlights today's date
size string "md" Changes the size of the date picker input field. Sizes: "sm", "md", "lg"
daysOfWeekDisabled array of integer [] Disables clicking on some days. Goes from 0 (Sunday) to 6 (Saturday).
viewMode string or number 'days' The default view to display when the picker is shown. ('years', 'months', 'days')
inputProps object undefined Defines additional attributes for the input element of the component.
minDate moment undefined The earliest date allowed for entry in the calendar view.
maxDate moment undefined The latest date allowed for entry in the calendar view.
mode string undefined Allows to selectively display only the time picker ('time') or the date picker ('date')
defaultText string {dateTime} Sets the initial value. Could be an empty string, or helper text.
icons object {base: "glyphicon",time: "glyphicon-time",date: "glyphicon-date",next: "glyphicon-chevron-right",prev: "glyphicon-chevron-left",up: "glyphicon-chevron-up",down: "glyphicon-chevron-down"} Sets custom icons classes in case of use icon set other than glyphicons ie. font awesome.

Update Warning

Starting from 0.0.6, the 3 github repositories react-bootstrap-datetimepicker, react-bootstrap-datetimepicker-npm and react-bootstrap-datetimepicker-bower are merged in a single one. The build process changed but the API is the same. However now the package exports DateTimeField directly, no need to do :

var DateTimeField = require('react-bootstrap-datetimepicker').DateTimeField;

instead use :

var DateTimeField = require('react-bootstrap-datetimepicker');

Contributions

There is still plenty of features missing compared to the original date time picker, hence contributions would be highly appreciated.

About

A react.js datetime picker for bootstrap

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%