From 182c2b620b74d8853bd9696c881f6e003b7a394c Mon Sep 17 00:00:00 2001
From: marquex <javi@arqex.com>
Date: Mon, 22 Jun 2015 20:08:55 +0200
Subject: [PATCH] Fixed time not decreasing added buttons for controls

---
 css/react-datetime.css     |   16 +++++++++++++++-
 dist/react-datetime.min.js |    4 ++--
 src/MonthsView.js          |    6 +++---
 src/TimeView.js            |    4 ++--
 dist/react-datetime.js     |   10 +++++-----
 package.json               |    2 +-
 src/DaysView.js            |    4 ++--
 src/YearsView.js           |    6 +++---
 README.md                  |    2 +-
 9 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md
index 02a5e5b..6d2bbbc 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@
 
 If there are multiple locales loaded, you can use the prop `locale` to define what language should be used by the instance:
 ```js
-<Datetime locale="fr" />
+<Datetime locale="fr-ca" />
 <Datetime locale="de" />
 ```
 [Here you can see the i18n example working](http://codepen.io/arqex/pen/PqJMQV).
diff --git a/css/react-datetime.css b/css/react-datetime.css
index 5a43b6f..2b92768 100644
--- a/css/react-datetime.css
+++ b/css/react-datetime.css
@@ -95,7 +95,7 @@
   border-bottom: none;
 }
 .rdtPicker th.switch {
-  width: 145px;
+  width: 100px;
 }
 .rdtPicker th.next,
 .rdtPicker th.prev {
@@ -119,6 +119,20 @@
 	border-top: 1px solid #f9f9f9;
 }
 
+.rdtPicker button {
+	border: none;
+	background: none;
+	cursor: pointer;
+}
+.rdtPicker button:hover {
+	background-color: #eee;
+}
+
+.rdtPicker thead button {
+	width: 100%;
+	height: 100%;
+}
+
 td.month,
 td.year {
 	height: 50px;
diff --git a/dist/react-datetime.js b/dist/react-datetime.js
index 9ad4bb4..4fe0d3e 100644
--- a/dist/react-datetime.js
+++ b/dist/react-datetime.js
@@ -1,5 +1,5 @@
 /*
-react-datetime v0.2.0
+react-datetime v0.3.1
 https://github.com/arqex/react-datetime
 MIT: https://github.com/arqex/react-datetime/raw/master/LICENSE
 */
@@ -65,7 +65,7 @@
 /* 1 */
 /***/ function(module, exports, __webpack_require__) {
 
-	eval("'use strict';\r\n\r\nvar React = __webpack_require__(2);\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerYears = React.createClass({\r\n\trenderYears: function( year ) {\r\n\t\tvar years = [],\r\n\t\t\ti = -1,\r\n\t\t\trows = [],\r\n\t\t\tclasses\r\n\t\t;\r\n\r\n\t\tyear--;\r\n\t\twhile (i < 11) {\r\n\t\t\tclasses = 'year';\r\n\t\t\tif( i === -1 | i === 10 )\r\n\t\t\t\tclasses += ' old';\r\n\t\t\tif( this.props.selectedDate.year() === year )\r\n\t\t\t\tclasses += ' active';\r\n\r\n\t\t\tyears.push( DOM.td({ key: year, className: classes, onClick: this.props.setDate('year') }, year ));\r\n\t\t\t// years.push(<td key={year} className={ classes } onClick={this.props.setDate('year')}>{year}</td>);\r\n\t\t\tif( years.length == 4 ){\r\n\t\t\t\trows.push( DOM.tr({ key: i }, years ) );\r\n\t\t\t\tyears = [];\r\n\t\t\t}\r\n\r\n\t\t\tyear++;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn rows;\r\n\t},\r\n\trender: function() {\r\n\t\tvar year = parseInt(this.props.viewDate.year() / 10, 10) * 10;\r\n\r\n\t\treturn DOM.div({ className: 'rdtYears' },[\r\n\t\t\tDOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[\r\n\t\t\t\tDOM.th({ key: 'prev', className: 'prev', onClick: this.props.subtractTime(10, 'years') }, '���'),\r\n\t\t\t\tDOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 5 }, year + '-' + (year + 9) ),\r\n\t\t\t\tDOM.th({ key: 'next', className: 'next', onClick: this.props.addTime(10, 'years')}, '���' )\r\n\t\t\t\t]))),\r\n\t\t\tDOM.table({ key: 'years'}, DOM.tbody({}, this.renderYears( year )))\r\n\t\t]);\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerYears;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/YearsView.js\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/YearsView.js?");
+	eval("'use strict';\r\n\r\nvar React = __webpack_require__(2);\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerYears = React.createClass({\r\n\trenderYears: function( year ) {\r\n\t\tvar years = [],\r\n\t\t\ti = -1,\r\n\t\t\trows = [],\r\n\t\t\tclasses\r\n\t\t;\r\n\r\n\t\tyear--;\r\n\t\twhile (i < 11) {\r\n\t\t\tclasses = 'year';\r\n\t\t\tif( i === -1 | i === 10 )\r\n\t\t\t\tclasses += ' old';\r\n\t\t\tif( this.props.selectedDate.year() === year )\r\n\t\t\t\tclasses += ' active';\r\n\r\n\t\t\tyears.push( DOM.td({ key: year, className: classes, onClick: this.props.setDate('year') }, year ));\r\n\t\t\t// years.push(<td key={year} className={ classes } onClick={this.props.setDate('year')}>{year}</td>);\r\n\t\t\tif( years.length == 4 ){\r\n\t\t\t\trows.push( DOM.tr({ key: i }, years ) );\r\n\t\t\t\tyears = [];\r\n\t\t\t}\r\n\r\n\t\t\tyear++;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn rows;\r\n\t},\r\n\trender: function() {\r\n\t\tvar year = parseInt(this.props.viewDate.year() / 10, 10) * 10;\r\n\r\n\t\treturn DOM.div({ className: 'rdtYears' },[\r\n\t\t\tDOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[\r\n\t\t\t\tDOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(10, 'years')}, '���')),\r\n\t\t\t\tDOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, year + '-' + (year + 9) ),\r\n\t\t\t\tDOM.th({ key: 'next', className: 'next'}, DOM.button({onClick: this.props.addTime(10, 'years')}, '���'))\r\n\t\t\t\t]))),\r\n\t\t\tDOM.table({ key: 'years'}, DOM.tbody({}, this.renderYears( year )))\r\n\t\t]);\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerYears;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/YearsView.js\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/YearsView.js?");
 
 /***/ },
 /* 2 */
@@ -83,7 +83,7 @@
 /* 4 */
 /***/ function(module, exports, __webpack_require__) {
 
-	eval("var React = __webpack_require__(2),\r\n\tmoment = __webpack_require__(5)\r\n;\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerDays = React.createClass({\r\n\r\n\trender: function() {\r\n\t\tvar footer = this.renderFooter(),\r\n\t\t\tdate = this.props.viewDate,\r\n\t\t\tlocale = date.localeData(),\r\n\t\t\ttableChildren\r\n\t\t;\r\n\r\n\t\ttableChildren = [\r\n\t\t\tDOM.thead({ key: 'th'}, [\r\n\t\t\t\tDOM.tr({ key: 'h'},[\r\n\t\t\t\t\tDOM.th({ key: 'p', className: 'prev', onClick: this.props.subtractTime(1, 'months') }, '���'),\r\n\t\t\t\t\tDOM.th({ key: 's', className: 'switch', onClick: this.props.showView('months'), colSpan: 5 }, locale.months( date ) + ' ' + date.year() ),\r\n\t\t\t\t\tDOM.th({ key: 'n', className: 'next', onClick: this.props.addTime(1, 'months')}, '���' )\r\n\t\t\t\t]),\r\n\t\t\t\tDOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day ){ return DOM.th({ key: day, className: 'dow'}, day ); }) )\r\n\t\t\t]),\r\n\t\t\tDOM.tbody({key: 'tb'}, this.renderDays())\r\n\t\t];\r\n\r\n\t\tif( footer )\r\n\t\t\ttableChildren.push( footer );\r\n\r\n\t\treturn DOM.div({ className: 'rdtDays' },\r\n\t\t\tDOM.table({}, tableChildren )\r\n\t\t);\r\n\t},\r\n\r\n\t/**\r\n\t * Get a list of the days of the week\r\n\t * depending on the current locale\r\n\t * @return {array} A list with the shortname of the days\r\n\t */\r\n\tgetDaysOfWeek: function( locale ){\r\n\t\tvar days = locale._weekdaysMin,\r\n\t\t\tfirst = locale.firstDayOfWeek(),\r\n\t\t\tdow = [],\r\n\t\t\ti = 0\r\n\t\t;\r\n\r\n\t\tdays.forEach( function( day ){\r\n\t\t\tdow[ (7 + (i++) - first) % 7 ] = day;\r\n\t\t});\r\n\r\n\t\treturn dow;\r\n\t},\r\n\r\n\trenderDays: function() {\r\n\t\tvar date = this.props.viewDate,\r\n\t\t\tselected = this.props.selectedDate,\r\n\t\t\tprevMonth = date.clone().subtract( 1, 'months' ),\r\n\t\t\tcurrentYear = date.year(),\r\n\t\t\tcurrentMonth = date.month(),\r\n\t\t\tselectedDate = {y: selected.year(), M: selected.month(), d: selected.date()},\r\n\t\t\tminDate = this.props.minDate,\r\n\t\t\tmaxDate = this.props.maxDate,\r\n\t\t\tweeks = [],\r\n\t\t\tdays = [],\r\n\t\t\tclasses, disabled, dayProps\r\n\t\t;\r\n\r\n\t\t// Go to the last week of the previous month\r\n\t\tprevMonth.date( prevMonth.daysInMonth() ).startOf('week');\r\n\t\tvar lastDay = prevMonth.clone().add(42, 'd');\r\n\r\n\t\twhile( prevMonth.isBefore( lastDay ) ){\r\n\t\t\tclasses = 'day';\r\n\r\n\t\t\tif( prevMonth.year() < currentYear || prevMonth.month() < currentMonth )\r\n\t\t\t\tclasses += ' old';\r\n\t\t\telse if( prevMonth.year() > currentYear || prevMonth.month() > currentMonth )\r\n\t\t\t\tclasses += ' new';\r\n\r\n\t\t\tif( prevMonth.isSame( selectedDate ) )\r\n\t\t\t\tclasses += ' active';\r\n\r\n\t\t\tif (prevMonth.isSame(moment(), 'day') )\r\n\t\t\t\tclasses += ' today';\r\n\r\n\t\t\tdisabled = minDate && prevMonth.isBefore(minDate) || maxDate && prevMonth.isAfter(maxDate);\r\n\t\t\tif( disabled )\r\n\t\t\t\tclasses += ' disabled';\r\n\r\n\t\t\tdayProps = { key: prevMonth.format('M_D'), className: classes };\r\n\t\t\tif( !disabled )\r\n\t\t\t\tdayProps.onClick = this.props.updateDate;\r\n\r\n\t\t\tdays.push( DOM.td( dayProps, prevMonth.date() ));\r\n\t\t\tif( days.length == 7 ){\r\n\t\t\t\tweeks.push( DOM.tr( {key: prevMonth.format('M_D')}, days ) );\r\n\t\t\t\tdays = [];\r\n\t\t\t}\r\n\r\n\t\t\tprevMonth.add( 1, 'd' );\r\n\t\t}\r\n\r\n\t\treturn weeks;\r\n\t},\r\n\r\n\trenderFooter: function(){\r\n\t\tif( !this.props.timeFormat )\r\n\t\t\treturn '';\r\n\r\n\t\treturn DOM.tfoot({ key: 'tf'},\r\n\t\t\tDOM.tr({},\r\n\t\t\t\tDOM.td({ onClick: this.props.showView('time'), colSpan: 7, className: 'timeToggle'}, this.props.selectedDate.format( this.props.timeFormat ))\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerDays;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/DaysView.js\n ** module id = 4\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/DaysView.js?");
+	eval("var React = __webpack_require__(2),\r\n\tmoment = __webpack_require__(5)\r\n;\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerDays = React.createClass({\r\n\r\n\trender: function() {\r\n\t\tvar footer = this.renderFooter(),\r\n\t\t\tdate = this.props.viewDate,\r\n\t\t\tlocale = date.localeData(),\r\n\t\t\ttableChildren\r\n\t\t;\r\n\r\n\t\ttableChildren = [\r\n\t\t\tDOM.thead({ key: 'th'}, [\r\n\t\t\t\tDOM.tr({ key: 'h'},[\r\n\t\t\t\t\tDOM.th({ key: 'p', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'months')}, '���')),\r\n\t\t\t\t\tDOM.th({ key: 's', className: 'switch', onClick: this.props.showView('months'), colSpan: 5 }, locale.months( date ) + ' ' + date.year() ),\r\n\t\t\t\t\tDOM.th({ key: 'n', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'months')}, '���'))\r\n\t\t\t\t]),\r\n\t\t\t\tDOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day ){ return DOM.th({ key: day, className: 'dow'}, day ); }) )\r\n\t\t\t]),\r\n\t\t\tDOM.tbody({key: 'tb'}, this.renderDays())\r\n\t\t];\r\n\r\n\t\tif( footer )\r\n\t\t\ttableChildren.push( footer );\r\n\r\n\t\treturn DOM.div({ className: 'rdtDays' },\r\n\t\t\tDOM.table({}, tableChildren )\r\n\t\t);\r\n\t},\r\n\r\n\t/**\r\n\t * Get a list of the days of the week\r\n\t * depending on the current locale\r\n\t * @return {array} A list with the shortname of the days\r\n\t */\r\n\tgetDaysOfWeek: function( locale ){\r\n\t\tvar days = locale._weekdaysMin,\r\n\t\t\tfirst = locale.firstDayOfWeek(),\r\n\t\t\tdow = [],\r\n\t\t\ti = 0\r\n\t\t;\r\n\r\n\t\tdays.forEach( function( day ){\r\n\t\t\tdow[ (7 + (i++) - first) % 7 ] = day;\r\n\t\t});\r\n\r\n\t\treturn dow;\r\n\t},\r\n\r\n\trenderDays: function() {\r\n\t\tvar date = this.props.viewDate,\r\n\t\t\tselected = this.props.selectedDate,\r\n\t\t\tprevMonth = date.clone().subtract( 1, 'months' ),\r\n\t\t\tcurrentYear = date.year(),\r\n\t\t\tcurrentMonth = date.month(),\r\n\t\t\tselectedDate = {y: selected.year(), M: selected.month(), d: selected.date()},\r\n\t\t\tminDate = this.props.minDate,\r\n\t\t\tmaxDate = this.props.maxDate,\r\n\t\t\tweeks = [],\r\n\t\t\tdays = [],\r\n\t\t\tclasses, disabled, dayProps\r\n\t\t;\r\n\r\n\t\t// Go to the last week of the previous month\r\n\t\tprevMonth.date( prevMonth.daysInMonth() ).startOf('week');\r\n\t\tvar lastDay = prevMonth.clone().add(42, 'd');\r\n\r\n\t\twhile( prevMonth.isBefore( lastDay ) ){\r\n\t\t\tclasses = 'day';\r\n\r\n\t\t\tif( prevMonth.year() < currentYear || prevMonth.month() < currentMonth )\r\n\t\t\t\tclasses += ' old';\r\n\t\t\telse if( prevMonth.year() > currentYear || prevMonth.month() > currentMonth )\r\n\t\t\t\tclasses += ' new';\r\n\r\n\t\t\tif( prevMonth.isSame( selectedDate ) )\r\n\t\t\t\tclasses += ' active';\r\n\r\n\t\t\tif (prevMonth.isSame(moment(), 'day') )\r\n\t\t\t\tclasses += ' today';\r\n\r\n\t\t\tdisabled = minDate && prevMonth.isBefore(minDate) || maxDate && prevMonth.isAfter(maxDate);\r\n\t\t\tif( disabled )\r\n\t\t\t\tclasses += ' disabled';\r\n\r\n\t\t\tdayProps = { key: prevMonth.format('M_D'), className: classes };\r\n\t\t\tif( !disabled )\r\n\t\t\t\tdayProps.onClick = this.props.updateDate;\r\n\r\n\t\t\tdays.push( DOM.td( dayProps, prevMonth.date() ));\r\n\t\t\tif( days.length == 7 ){\r\n\t\t\t\tweeks.push( DOM.tr( {key: prevMonth.format('M_D')}, days ) );\r\n\t\t\t\tdays = [];\r\n\t\t\t}\r\n\r\n\t\t\tprevMonth.add( 1, 'd' );\r\n\t\t}\r\n\r\n\t\treturn weeks;\r\n\t},\r\n\r\n\trenderFooter: function(){\r\n\t\tif( !this.props.timeFormat )\r\n\t\t\treturn '';\r\n\r\n\t\treturn DOM.tfoot({ key: 'tf'},\r\n\t\t\tDOM.tr({},\r\n\t\t\t\tDOM.td({ onClick: this.props.showView('time'), colSpan: 7, className: 'timeToggle'}, this.props.selectedDate.format( this.props.timeFormat ))\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerDays;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/DaysView.js\n ** module id = 4\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/DaysView.js?");
 
 /***/ },
 /* 5 */
@@ -95,13 +95,13 @@
 /* 6 */
 /***/ function(module, exports, __webpack_require__) {
 
-	eval("'use strict';\r\n\r\nvar React = __webpack_require__(2),\r\nmoment = __webpack_require__(5)\r\n;\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerMonths = React.createClass({\r\n\trenderMonths: function() {\r\n\t\tvar date = this.props.selectedDate,\r\n\t\t\tmonth = date.month(),\r\n\t\t\tmonthsShort = date.localeData()._monthsShort,\r\n\t\t\trows = [],\r\n\t\t\ti = 0,\r\n\t\t\tmonths = [],\r\n\t\t\tclasses\r\n\t\t;\r\n\r\n\t\twhile (i < 12) {\r\n\t\t\tclasses = \"month\";\r\n\t\t\tif( i === month && this.props.viewDate.year() === date.year() )\r\n\t\t\t\tclasses += \" active\";\r\n\r\n\t\t\tmonths.push( DOM.td( {key: i, className: classes, onClick: this.props.setDate('month') }, monthsShort[ i ] ));\r\n\t\t\tif( months.length == 4 ){\r\n\t\t\t\trows.push( DOM.tr({ key: month + '_' + rows.length }, months) );\r\n\t\t\t\tmonths = [];\r\n\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t},\r\n\r\n\trender: function() {\r\n\t\treturn DOM.div({ className: 'rdtMonths' },[\r\n\t\t\tDOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[\r\n\t\t\t\tDOM.th({ key: 'prev', className: 'prev', onClick: this.props.subtractTime(1, 'years') }, '���'),\r\n\t\t\t\tDOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 5 }, this.props.viewDate.year() ),\r\n\t\t\t\tDOM.th({ key: 'next', className: 'next', onClick: this.props.addTime(1, 'years')}, '���' )\r\n\t\t\t]))),\r\n\t\t\tDOM.table({ key: 'months'}, DOM.tbody({ key: 'b'}, this.renderMonths()))\r\n\t\t]);\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerMonths;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/MonthsView.js\n ** module id = 6\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/MonthsView.js?");
+	eval("'use strict';\r\n\r\nvar React = __webpack_require__(2),\r\nmoment = __webpack_require__(5)\r\n;\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerMonths = React.createClass({\r\n\trenderMonths: function() {\r\n\t\tvar date = this.props.selectedDate,\r\n\t\t\tmonth = date.month(),\r\n\t\t\tmonthsShort = date.localeData()._monthsShort,\r\n\t\t\trows = [],\r\n\t\t\ti = 0,\r\n\t\t\tmonths = [],\r\n\t\t\tclasses\r\n\t\t;\r\n\r\n\t\twhile (i < 12) {\r\n\t\t\tclasses = \"month\";\r\n\t\t\tif( i === month && this.props.viewDate.year() === date.year() )\r\n\t\t\t\tclasses += \" active\";\r\n\r\n\t\t\tmonths.push( DOM.td( {key: i, className: classes, onClick: this.props.setDate('month') }, monthsShort[ i ] ));\r\n\t\t\tif( months.length == 4 ){\r\n\t\t\t\trows.push( DOM.tr({ key: month + '_' + rows.length }, months) );\r\n\t\t\t\tmonths = [];\r\n\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t},\r\n\r\n\trender: function() {\r\n\t\treturn DOM.div({ className: 'rdtMonths' },[\r\n\t\t\tDOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[\r\n\t\t\t\tDOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'years')}, '���')),\r\n\t\t\t\tDOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, this.props.viewDate.year() ),\r\n\t\t\t\tDOM.th({ key: 'next', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'years')}, '���'))\r\n\t\t\t]))),\r\n\t\t\tDOM.table({ key: 'months'}, DOM.tbody({ key: 'b'}, this.renderMonths()))\r\n\t\t]);\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerMonths;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/MonthsView.js\n ** module id = 6\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/MonthsView.js?");
 
 /***/ },
 /* 7 */
 /***/ function(module, exports, __webpack_require__) {
 
-	eval("'use strict';\r\n\r\nvar React = __webpack_require__(2);\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerTime = React.createClass({\r\n\tgetInitialState: function(){\r\n\t\tvar date = this.props.selectedDate,\r\n\t\t\tformat = this.props.timeFormat,\r\n\t\t\tcounters = []\r\n\t\t;\r\n\r\n\t\tif( format.indexOf('H') != -1 || format.indexOf('h') != -1 ){\r\n\t\t\tcounters.push('hours');\r\n\t\t\tif( format.indexOf('m') != -1 ){\r\n\t\t\t\tcounters.push('minutes');\r\n\t\t\t\tif( format.indexOf('s') != -1 ){\r\n\t\t\t\t\tcounters.push('seconds');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\thours: date.format('H'),\r\n\t\t\tminutes: date.format('mm'),\r\n\t\t\tseconds: date.format('ss'),\r\n\t\t\tmilliseconds: date.format('SSS'),\r\n\t\t\tcounters: counters\r\n\t\t};\r\n\t},\r\n\trenderCounter: function( type ){\r\n\t\treturn DOM.div({ key: type, className: 'rdtCounter'}, [\r\n\t\t\tDOM.div({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '���' ),\r\n\t\t\tDOM.div({ key:'c', className: 'rdtCount' }, this.state[ type ] ),\r\n\t\t\tDOM.div({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '���' )\r\n\t\t]);\r\n\t},\r\n\trender: function() {\r\n\t\tvar me = this,\r\n\t\t\tcounters = []\r\n\t\t;\r\n\r\n\t\tthis.state.counters.forEach( function(c){\r\n\t\t\tif( counters.length )\r\n\t\t\t\tcounters.push( DOM.div( {key: 'sep' + counters.length, className: 'rdtCounterSeparator' }, ':' ));\r\n\t\t\tcounters.push( me.renderCounter( c ) );\r\n\t\t});\r\n\r\n\t\tif( this.state.counters.length == 3 && this.props.timeFormat.indexOf('S') != -1 ){\r\n\t\t\tcounters.push( DOM.div( {className: 'rdtCounterSeparator', key: 'sep5' }, ':' ));\r\n\t\t\tcounters.push(\r\n\t\t\t\tDOM.div( {className: 'rdtCounter rdtMilli', key:'m'},\r\n\t\t\t\t\tDOM.input({ value: this.state.milliseconds, type: 'text', onChange: this.updateMilli })\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn DOM.div( {className: 'rdtTime'},\r\n\t\t\tDOM.table( {}, [\r\n\t\t\t\tthis.renderHeader(),\r\n\t\t\t\tDOM.tbody({key: 'b'}, DOM.tr({}, DOM.td({},\r\n\t\t\t\t\tDOM.div({ className: 'rdtCounters' }, counters )\r\n\t\t\t\t)))\r\n\t\t\t])\r\n\t\t);\r\n\r\n\t},\r\n\tupdateMilli: function( e ){\r\n\t\tvar milli = parseInt( e.target.value );\r\n\t\tif( milli == e.target.value && milli >= 0 && milli < 1000 ){\r\n\t\t\tthis.props.setTime( 'milliseconds', milli );\r\n\t\t\tthis.setState({ milliseconds: milli });\r\n\t\t}\r\n\t},\r\n\trenderHeader: function(){\r\n\t\tif( !this.props.dateFormat )\r\n\t\t\treturn '';\r\n\r\n\t\treturn DOM.thead({ key: 'h'}, DOM.tr({},\r\n\t\t\tDOM.th( {colSpan: 4, onClick: this.props.showView('days')}, this.props.selectedDate.format( this.props.dateFormat ) )\r\n\t\t));\r\n\t},\r\n\tonStartClicking: function( action, type ){\r\n\t\tvar me = this,\r\n\t\t\tupdate = {}\r\n\t\t;\r\n\t\treturn function(){\r\n\t\t\tvar update = {};\r\n\t\t\tupdate[ type ] = me[ action ]( type );\r\n\t\t\tme.setState( update );\r\n\r\n\t\t\tme.timer = setTimeout( function(){\r\n\t\t\t\tme.increaseTimer = setInterval( function(){\r\n\t\t\t\t\tupdate[ type ] = me[ action ]( type );\r\n\t\t\t\t\tme.setState( update );\r\n\t\t\t\t},80);\r\n\t\t\t}, 500);\r\n\r\n\t\t\tdocument.body.addEventListener('mouseup', function(){\r\n\t\t\t\tclearTimeout( me.timer );\r\n\t\t\t\tclearInterval( me.increaseTimer );\r\n\t\t\t\tme.props.setTime( type, me.state[ type ] );\r\n\t\t\t});\r\n\t\t};\r\n\t},\r\n\r\n\tmaxValues: {\r\n\t\thours: 23,\r\n\t\tminutes: 59,\r\n\t\tseconds: 59,\r\n\t\tmilliseconds: 999\r\n\t},\r\n\tpadValues: {\r\n\t\thours: 1,\r\n\t\tminutes: 2,\r\n\t\tseconds: 2,\r\n\t\tmilliseconds: 3\r\n\t},\r\n\tincrease: function( type ){\r\n\t\tvar value = parseInt(this.state[ type ]) + 1;\r\n\t\tif( value > this.maxValues[ type ] )\r\n\t\t\tvalue = 0;\r\n\t\treturn this.pad( type, value );\r\n\t},\r\n\tdecrease: function( type ){\r\n\t\tvar value = parseInt(this.state[ type ]) - 1;\r\n\t\tif( value < 0 )\r\n\t\t\tvalue = this.maxValues[ type ];\r\n\t\treturn this.pad( type, value );\r\n\t},\r\n\tpad: function( type, value ){\r\n\t\tvar str = value + '';\r\n\t\twhile( str.length < this.padValues[ type ] )\r\n\t\t\tstr = '0' + str;\r\n\t\treturn str;\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerTime;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/TimeView.js\n ** module id = 7\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/TimeView.js?");
+	eval("'use strict';\r\n\r\nvar React = __webpack_require__(2);\r\n\r\nvar DOM = React.DOM;\r\nvar DateTimePickerTime = React.createClass({\r\n\tgetInitialState: function(){\r\n\t\tvar date = this.props.selectedDate,\r\n\t\t\tformat = this.props.timeFormat,\r\n\t\t\tcounters = []\r\n\t\t;\r\n\r\n\t\tif( format.indexOf('H') != -1 || format.indexOf('h') != -1 ){\r\n\t\t\tcounters.push('hours');\r\n\t\t\tif( format.indexOf('m') != -1 ){\r\n\t\t\t\tcounters.push('minutes');\r\n\t\t\t\tif( format.indexOf('s') != -1 ){\r\n\t\t\t\t\tcounters.push('seconds');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\thours: date.format('H'),\r\n\t\t\tminutes: date.format('mm'),\r\n\t\t\tseconds: date.format('ss'),\r\n\t\t\tmilliseconds: date.format('SSS'),\r\n\t\t\tcounters: counters\r\n\t\t};\r\n\t},\r\n\trenderCounter: function( type ){\r\n\t\treturn DOM.div({ key: type, className: 'rdtCounter'}, [\r\n\t\t\tDOM.button({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '���' ),\r\n\t\t\tDOM.div({ key:'c', className: 'rdtCount' }, this.state[ type ] ),\r\n\t\t\tDOM.button({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'decrease', type ) }, '���' )\r\n\t\t]);\r\n\t},\r\n\trender: function() {\r\n\t\tvar me = this,\r\n\t\t\tcounters = []\r\n\t\t;\r\n\r\n\t\tthis.state.counters.forEach( function(c){\r\n\t\t\tif( counters.length )\r\n\t\t\t\tcounters.push( DOM.div( {key: 'sep' + counters.length, className: 'rdtCounterSeparator' }, ':' ));\r\n\t\t\tcounters.push( me.renderCounter( c ) );\r\n\t\t});\r\n\r\n\t\tif( this.state.counters.length == 3 && this.props.timeFormat.indexOf('S') != -1 ){\r\n\t\t\tcounters.push( DOM.div( {className: 'rdtCounterSeparator', key: 'sep5' }, ':' ));\r\n\t\t\tcounters.push(\r\n\t\t\t\tDOM.div( {className: 'rdtCounter rdtMilli', key:'m'},\r\n\t\t\t\t\tDOM.input({ value: this.state.milliseconds, type: 'text', onChange: this.updateMilli })\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn DOM.div( {className: 'rdtTime'},\r\n\t\t\tDOM.table( {}, [\r\n\t\t\t\tthis.renderHeader(),\r\n\t\t\t\tDOM.tbody({key: 'b'}, DOM.tr({}, DOM.td({},\r\n\t\t\t\t\tDOM.div({ className: 'rdtCounters' }, counters )\r\n\t\t\t\t)))\r\n\t\t\t])\r\n\t\t);\r\n\r\n\t},\r\n\tupdateMilli: function( e ){\r\n\t\tvar milli = parseInt( e.target.value );\r\n\t\tif( milli == e.target.value && milli >= 0 && milli < 1000 ){\r\n\t\t\tthis.props.setTime( 'milliseconds', milli );\r\n\t\t\tthis.setState({ milliseconds: milli });\r\n\t\t}\r\n\t},\r\n\trenderHeader: function(){\r\n\t\tif( !this.props.dateFormat )\r\n\t\t\treturn '';\r\n\r\n\t\treturn DOM.thead({ key: 'h'}, DOM.tr({},\r\n\t\t\tDOM.th( {colSpan: 4, onClick: this.props.showView('days')}, this.props.selectedDate.format( this.props.dateFormat ) )\r\n\t\t));\r\n\t},\r\n\tonStartClicking: function( action, type ){\r\n\t\tvar me = this,\r\n\t\t\tupdate = {}\r\n\t\t;\r\n\t\treturn function(){\r\n\t\t\tvar update = {};\r\n\t\t\tupdate[ type ] = me[ action ]( type );\r\n\t\t\tme.setState( update );\r\n\r\n\t\t\tme.timer = setTimeout( function(){\r\n\t\t\t\tme.increaseTimer = setInterval( function(){\r\n\t\t\t\t\tupdate[ type ] = me[ action ]( type );\r\n\t\t\t\t\tme.setState( update );\r\n\t\t\t\t},80);\r\n\t\t\t}, 500);\r\n\r\n\t\t\tdocument.body.addEventListener('mouseup', function(){\r\n\t\t\t\tclearTimeout( me.timer );\r\n\t\t\t\tclearInterval( me.increaseTimer );\r\n\t\t\t\tme.props.setTime( type, me.state[ type ] );\r\n\t\t\t});\r\n\t\t};\r\n\t},\r\n\r\n\tmaxValues: {\r\n\t\thours: 23,\r\n\t\tminutes: 59,\r\n\t\tseconds: 59,\r\n\t\tmilliseconds: 999\r\n\t},\r\n\tpadValues: {\r\n\t\thours: 1,\r\n\t\tminutes: 2,\r\n\t\tseconds: 2,\r\n\t\tmilliseconds: 3\r\n\t},\r\n\tincrease: function( type ){\r\n\t\tvar value = parseInt(this.state[ type ]) + 1;\r\n\t\tif( value > this.maxValues[ type ] )\r\n\t\t\tvalue = 0;\r\n\t\treturn this.pad( type, value );\r\n\t},\r\n\tdecrease: function( type ){\r\n\t\tvar value = parseInt(this.state[ type ]) - 1;\r\n\t\tif( value < 0 )\r\n\t\t\tvalue = this.maxValues[ type ];\r\n\t\treturn this.pad( type, value );\r\n\t},\r\n\tpad: function( type, value ){\r\n\t\tvar str = value + '';\r\n\t\twhile( str.length < this.padValues[ type ] )\r\n\t\t\tstr = '0' + str;\r\n\t\treturn str;\r\n\t}\r\n});\r\n\r\nmodule.exports = DateTimePickerTime;\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/TimeView.js\n ** module id = 7\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/TimeView.js?");
 
 /***/ },
 /* 8 */
diff --git a/dist/react-datetime.min.js b/dist/react-datetime.min.js
index e733444..cf93274 100644
--- a/dist/react-datetime.min.js
+++ b/dist/react-datetime.min.js
@@ -1,6 +1,6 @@
 /*
-react-datetime v0.2.0
+react-datetime v0.3.1
 https://github.com/arqex/react-datetime
 MIT: https://github.com/arqex/react-datetime/raw/master/LICENSE
 */
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require(void 0),require(void 0)):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.Datetime=e(require(void 0),require(void 0)):t.Datetime=e(t.React,t.moment)}(this,function(t,e){return function(t){function e(n){if(s[n])return s[n].exports;var a=s[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){"use strict";var n=s(3),a=s(2),r=s(4),i=s(6),o=s(1),c=s(7),u=s(5),d=a.PropTypes,l=a.createClass({mixins:[s(8)],viewComponents:{days:r,months:i,years:o,time:c},propTypes:{date:d.object,onChange:d.func,locale:d.string,input:d.bool,dateFormat:d.string,timeFormat:d.string,inputProps:d.object,viewMode:d.oneOf(["years","months","days","time"]),minDate:d.object,maxDate:d.object},getDefaultProps:function(){return{date:new Date,viewMode:"days",inputProps:{},input:!0,onChange:function(t){console.log(t)}}},getInitialState:function(){var t=this.getFormats(this.props),e=this.props.date;return{currentView:this.props.viewMode,open:!this.props.input,inputFormat:t.datetime,viewDate:this.localMoment(e).startOf("month"),selectedDate:this.localMoment(e),inputValue:this.localMoment(e).format(t.datetime)}},getFormats:function(t){var e={date:"",time:"",datetime:""},s=this.localMoment(t.date).localeData();return t.dateFormat&&(e.date=t.dateFormat),t.timeFormat&&(e.time=t.timeFormat),e.date||e.time?(t.dateFormat&&(e.date=t.dateFormat,e.datetime=e.date),t.timeFormat&&(e.date&&(e.datetime+=" "),e.time=t.timeFormat,e.datetime+=e.time)):(e.date=s.longDateFormat("L"),e.time=s.longDateFormat("LT"),e.datetime=e.date+" "+e.time),e},componentWillReceiveProps:function(t){var e=this.getFormats(t);return e.datetime!==this.getFormats(this.props).datetime?this.setState({inputFormat:t.inputFormat}):void 0},onChange:function(t){var e=null==t.target?t:t.target.value,s=this.localMoment(date);return s.isValid()&&this.setState({selectedDate:s,viewDate:s.clone().startOf("month")}),this.setState({inputValue:e},function(){return this.props.onChange(s.toDate())})},showView:function(t){var e=this;return function(s){e.setState({currentView:t})}},setDate:function(t){var e=this,s={month:"days",year:"months"};return function(n){e.setState({viewDate:e.state.viewDate.clone()[t](n.target.innerHTML).startOf(t),currentView:s[t]})}},addTime:function(t,e,s){return this.updateTime("add",t,e,s)},subtractTime:function(t,e,s){return this.updateTime("subtract",t,e,s)},updateTime:function(t,e,s,n){var a=this;return function(){var r={},i=n?"selectedDate":"viewDate";r[i]=a.state[i].clone()[t](e,s),a.setState(r)}},allowedSetTime:["hours","minutes","seconds","milliseconds"],setTime:function(t,e){var s,n=this.allowedSetTime.indexOf(t)+1,a=this.state.selectedDate.clone();for(a[t](e);n<this.allowedSetTime.length;n++)s=this.allowedSetTime[n],a[s](a[s]());this.setState({selectedDate:a,inputValue:a.format(this.state.inputFormat)},this.callOnChange)},callOnChange:function(){this.props.onChange(this.state.selectedDate.format(this.state.inputFormat))},updateDate:function(t){var e,s=t.target,n=0,a=this.state.selectedDate;-1!=s.className.indexOf("new")?n=1:-1!=s.className.indexOf("old")&&(n=-1),e=this.state.viewDate.clone().month(this.state.viewDate.month()+n).date(parseInt(s.innerHTML)).hours(a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds()),this.setState({selectedDate:e,viewDate:e.clone().startOf("month"),inputValue:e.format(this.state.inputFormat)})},openCalendar:function(){this.setState({open:!0})},handleClickOutside:function(){this.props.input&&this.state.open&&this.setState({open:!1})},localMoment:function(t){var e=u(t);return this.props.locale&&e.locale(this.props.locale),e},componentProps:{fromProps:["viewMode","minDate","maxDate"],fromState:["viewDate","selectedDate"],fromThis:["setDate","setTime","showView","addTime","subtractTime","updateDate","localMoment"]},getComponentProps:function(){var t=this,e=this.getFormats(this.props),s={dateFormat:e.date,timeFormat:e.time};return this.componentProps.fromProps.forEach(function(e){s[e]=t.props[e]}),this.componentProps.fromState.forEach(function(e){s[e]=t.state[e]}),this.componentProps.fromThis.forEach(function(e){s[e]=t[e]}),s},render:function(){var t=this.viewComponents[this.state.currentView],e=a.DOM,s="rdt",r=[];return this.props.input?r=[e.input(n({key:"i",type:"text",className:"form-control",onFocus:this.openCalendar,onChange:this.onChange,value:this.state.inputValue},this.props.inputProps))]:s+=" rdtStatic",this.state.open&&(s+=" rdtOpen"),e.div({className:s},r.concat(e.div({key:"dt",className:"rdtPicker"},a.createElement(t,this.getComponentProps()))))}});t.exports=l},function(t,e,s){"use strict";var n=s(2),a=n.DOM,r=n.createClass({renderYears:function(t){var e,s=[],n=-1,r=[];for(t--;11>n;)e="year",-1===n|10===n&&(e+=" old"),this.props.selectedDate.year()===t&&(e+=" active"),s.push(a.td({key:t,className:e,onClick:this.props.setDate("year")},t)),4==s.length&&(r.push(a.tr({key:n},s)),s=[]),t++,n++;return r},render:function(){var t=10*parseInt(this.props.viewDate.year()/10,10);return a.div({className:"rdtYears"},[a.table({key:"a"},a.thead({},a.tr({},[a.th({key:"prev",className:"prev",onClick:this.props.subtractTime(10,"years")},"���"),a.th({key:"year",className:"switch",onClick:this.props.showView("years"),colSpan:5},t+"-"+(t+9)),a.th({key:"next",className:"next",onClick:this.props.addTime(10,"years")},"���")]))),a.table({key:"years"},a.tbody({},this.renderYears(t)))])}});t.exports=r},function(e,s){e.exports=t},function(t,e){"use strict";function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(t){var e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t))),e.filter(function(e){return a.call(t,e)})}var a=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var a,r,i=s(t),o=1;o<arguments.length;o++){a=arguments[o],r=n(Object(a));for(var c=0;c<r.length;c++)i[r[c]]=a[r[c]]}return i}},function(t,e,s){var n=s(2),a=s(5),r=n.DOM,i=n.createClass({render:function(){var t,e=this.renderFooter(),s=this.props.viewDate,n=s.localeData();return t=[r.thead({key:"th"},[r.tr({key:"h"},[r.th({key:"p",className:"prev",onClick:this.props.subtractTime(1,"months")},"���"),r.th({key:"s",className:"switch",onClick:this.props.showView("months"),colSpan:5},n.months(s)+" "+s.year()),r.th({key:"n",className:"next",onClick:this.props.addTime(1,"months")},"���")]),r.tr({key:"d"},this.getDaysOfWeek(n).map(function(t){return r.th({key:t,className:"dow"},t)}))]),r.tbody({key:"tb"},this.renderDays())],e&&t.push(e),r.div({className:"rdtDays"},r.table({},t))},getDaysOfWeek:function(t){var e=t._weekdaysMin,s=t.firstDayOfWeek(),n=[],a=0;return e.forEach(function(t){n[(7+a++-s)%7]=t}),n},renderDays:function(){var t,e,s,n=this.props.viewDate,i=this.props.selectedDate,o=n.clone().subtract(1,"months"),c=n.year(),u=n.month(),d={y:i.year(),M:i.month(),d:i.date()},l=this.props.minDate,p=this.props.maxDate,h=[],m=[];o.date(o.daysInMonth()).startOf("week");for(var f=o.clone().add(42,"d");o.isBefore(f);)t="day",o.year()<c||o.month()<u?t+=" old":(o.year()>c||o.month()>u)&&(t+=" new"),o.isSame(d)&&(t+=" active"),o.isSame(a(),"day")&&(t+=" today"),e=l&&o.isBefore(l)||p&&o.isAfter(p),e&&(t+=" disabled"),s={key:o.format("M_D"),className:t},e||(s.onClick=this.props.updateDate),m.push(r.td(s,o.date())),7==m.length&&(h.push(r.tr({key:o.format("M_D")},m)),m=[]),o.add(1,"d");return h},renderFooter:function(){return this.props.timeFormat?r.tfoot({key:"tf"},r.tr({},r.td({onClick:this.props.showView("time"),colSpan:7,className:"timeToggle"},this.props.selectedDate.format(this.props.timeFormat)))):""}});t.exports=i},function(t,s){t.exports=e},function(t,e,s){"use strict";var n=s(2),a=(s(5),n.DOM),r=n.createClass({renderMonths:function(){for(var t,e=this.props.selectedDate,s=e.month(),n=e.localeData()._monthsShort,r=[],i=0,o=[];12>i;)t="month",i===s&&this.props.viewDate.year()===e.year()&&(t+=" active"),o.push(a.td({key:i,className:t,onClick:this.props.setDate("month")},n[i])),4==o.length&&(r.push(a.tr({key:s+"_"+r.length},o)),o=[]),i++;return r},render:function(){return a.div({className:"rdtMonths"},[a.table({key:"a"},a.thead({},a.tr({},[a.th({key:"prev",className:"prev",onClick:this.props.subtractTime(1,"years")},"���"),a.th({key:"year",className:"switch",onClick:this.props.showView("years"),colSpan:5},this.props.viewDate.year()),a.th({key:"next",className:"next",onClick:this.props.addTime(1,"years")},"���")]))),a.table({key:"months"},a.tbody({key:"b"},this.renderMonths()))])}});t.exports=r},function(t,e,s){"use strict";var n=s(2),a=n.DOM,r=n.createClass({getInitialState:function(){var t=this.props.selectedDate,e=this.props.timeFormat,s=[];return(-1!=e.indexOf("H")||-1!=e.indexOf("h"))&&(s.push("hours"),-1!=e.indexOf("m")&&(s.push("minutes"),-1!=e.indexOf("s")&&s.push("seconds"))),{hours:t.format("H"),minutes:t.format("mm"),seconds:t.format("ss"),milliseconds:t.format("SSS"),counters:s}},renderCounter:function(t){return a.div({key:t,className:"rdtCounter"},[a.div({key:"up",className:"btn",onMouseDown:this.onStartClicking("increase",t)},"���"),a.div({key:"c",className:"rdtCount"},this.state[t]),a.div({key:"do",className:"btn",onMouseDown:this.onStartClicking("increase",t)},"���")])},render:function(){var t=this,e=[];return this.state.counters.forEach(function(s){e.length&&e.push(a.div({key:"sep"+e.length,className:"rdtCounterSeparator"},":")),e.push(t.renderCounter(s))}),3==this.state.counters.length&&-1!=this.props.timeFormat.indexOf("S")&&(e.push(a.div({className:"rdtCounterSeparator",key:"sep5"},":")),e.push(a.div({className:"rdtCounter rdtMilli",key:"m"},a.input({value:this.state.milliseconds,type:"text",onChange:this.updateMilli})))),a.div({className:"rdtTime"},a.table({},[this.renderHeader(),a.tbody({key:"b"},a.tr({},a.td({},a.div({className:"rdtCounters"},e))))]))},updateMilli:function(t){var e=parseInt(t.target.value);e==t.target.value&&e>=0&&1e3>e&&(this.props.setTime("milliseconds",e),this.setState({milliseconds:e}))},renderHeader:function(){return this.props.dateFormat?a.thead({key:"h"},a.tr({},a.th({colSpan:4,onClick:this.props.showView("days")},this.props.selectedDate.format(this.props.dateFormat)))):""},onStartClicking:function(t,e){var s=this;return function(){var n={};n[e]=s[t](e),s.setState(n),s.timer=setTimeout(function(){s.increaseTimer=setInterval(function(){n[e]=s[t](e),s.setState(n)},80)},500),document.body.addEventListener("mouseup",function(){clearTimeout(s.timer),clearInterval(s.increaseTimer),s.props.setTime(e,s.state[e])})}},maxValues:{hours:23,minutes:59,seconds:59,milliseconds:999},padValues:{hours:1,minutes:2,seconds:2,milliseconds:3},increase:function(t){var e=parseInt(this.state[t])+1;return e>this.maxValues[t]&&(e=0),this.pad(t,e)},decrease:function(t){var e=parseInt(this.state[t])-1;return 0>e&&(e=this.maxValues[t]),this.pad(t,e)},pad:function(t,e){for(var s=e+"";s.length<this.padValues[t];)s="0"+s;return s}});t.exports=r},function(t,e,s){var n,a,r;!function(s,i){a=[],n=i,r="function"==typeof n?n.apply(e,a):n,!(void 0!==r&&(t.exports=r))}(this,function(){"use strict";var t=[],e=[],s="ignore-react-onclickoutside";return{componentDidMount:function(){if(!this.handleClickOutside)throw new Error("Component lacks a handleClickOutside(event) function for processing outside click events.");var n=this.__outsideClickHandler=function(t,e){return function(n){for(var a=n.target,r=!1;a.parentNode;){if(r=a===t||a.classList.contains(s))return;a=a.parentNode}e(n)}}(this.getDOMNode(),this.handleClickOutside),a=t.length;t.push(this),e[a]=n,this.props.disableOnClickOutside||this.enableOnClickOutside()},componentWillUnmount:function(){this.disableOnClickOutside(),this.__outsideClickHandler=!1;var s=t.indexOf(this);s>-1&&e[s]&&(e.splice(s,1),t.splice(s,1))},enableOnClickOutside:function(){var t=this.__outsideClickHandler;document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)},disableOnClickOutside:function(t){var t=this.__outsideClickHandler;document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}})}])});
\ No newline at end of file
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require(void 0),require(void 0)):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.Datetime=e(require(void 0),require(void 0)):t.Datetime=e(t.React,t.moment)}(this,function(t,e){return function(t){function e(n){if(s[n])return s[n].exports;var a=s[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){"use strict";var n=s(3),a=s(2),r=s(4),o=s(6),i=s(1),c=s(7),u=s(5),d=a.PropTypes,l=a.createClass({mixins:[s(8)],viewComponents:{days:r,months:o,years:i,time:c},propTypes:{date:d.object,onChange:d.func,locale:d.string,input:d.bool,dateFormat:d.string,timeFormat:d.string,inputProps:d.object,viewMode:d.oneOf(["years","months","days","time"]),minDate:d.object,maxDate:d.object},getDefaultProps:function(){return{date:new Date,viewMode:"days",inputProps:{},input:!0,onChange:function(t){console.log(t)}}},getInitialState:function(){var t=this.getFormats(this.props),e=this.props.date;return{currentView:this.props.viewMode,open:!this.props.input,inputFormat:t.datetime,viewDate:this.localMoment(e).startOf("month"),selectedDate:this.localMoment(e),inputValue:this.localMoment(e).format(t.datetime)}},getFormats:function(t){var e={date:"",time:"",datetime:""},s=this.localMoment(t.date).localeData();return t.dateFormat&&(e.date=t.dateFormat),t.timeFormat&&(e.time=t.timeFormat),e.date||e.time?(t.dateFormat&&(e.date=t.dateFormat,e.datetime=e.date),t.timeFormat&&(e.date&&(e.datetime+=" "),e.time=t.timeFormat,e.datetime+=e.time)):(e.date=s.longDateFormat("L"),e.time=s.longDateFormat("LT"),e.datetime=e.date+" "+e.time),e},componentWillReceiveProps:function(t){var e=this.getFormats(t);return e.datetime!==this.getFormats(this.props).datetime?this.setState({inputFormat:t.inputFormat}):void 0},onChange:function(t){var e=null==t.target?t:t.target.value,s=this.localMoment(date);return s.isValid()&&this.setState({selectedDate:s,viewDate:s.clone().startOf("month")}),this.setState({inputValue:e},function(){return this.props.onChange(s.toDate())})},showView:function(t){var e=this;return function(s){e.setState({currentView:t})}},setDate:function(t){var e=this,s={month:"days",year:"months"};return function(n){e.setState({viewDate:e.state.viewDate.clone()[t](n.target.innerHTML).startOf(t),currentView:s[t]})}},addTime:function(t,e,s){return this.updateTime("add",t,e,s)},subtractTime:function(t,e,s){return this.updateTime("subtract",t,e,s)},updateTime:function(t,e,s,n){var a=this;return function(){var r={},o=n?"selectedDate":"viewDate";r[o]=a.state[o].clone()[t](e,s),a.setState(r)}},allowedSetTime:["hours","minutes","seconds","milliseconds"],setTime:function(t,e){var s,n=this.allowedSetTime.indexOf(t)+1,a=this.state.selectedDate.clone();for(a[t](e);n<this.allowedSetTime.length;n++)s=this.allowedSetTime[n],a[s](a[s]());this.setState({selectedDate:a,inputValue:a.format(this.state.inputFormat)},this.callOnChange)},callOnChange:function(){this.props.onChange(this.state.selectedDate.format(this.state.inputFormat))},updateDate:function(t){var e,s=t.target,n=0,a=this.state.selectedDate;-1!=s.className.indexOf("new")?n=1:-1!=s.className.indexOf("old")&&(n=-1),e=this.state.viewDate.clone().month(this.state.viewDate.month()+n).date(parseInt(s.innerHTML)).hours(a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds()),this.setState({selectedDate:e,viewDate:e.clone().startOf("month"),inputValue:e.format(this.state.inputFormat)})},openCalendar:function(){this.setState({open:!0})},handleClickOutside:function(){this.props.input&&this.state.open&&this.setState({open:!1})},localMoment:function(t){var e=u(t);return this.props.locale&&e.locale(this.props.locale),e},componentProps:{fromProps:["viewMode","minDate","maxDate"],fromState:["viewDate","selectedDate"],fromThis:["setDate","setTime","showView","addTime","subtractTime","updateDate","localMoment"]},getComponentProps:function(){var t=this,e=this.getFormats(this.props),s={dateFormat:e.date,timeFormat:e.time};return this.componentProps.fromProps.forEach(function(e){s[e]=t.props[e]}),this.componentProps.fromState.forEach(function(e){s[e]=t.state[e]}),this.componentProps.fromThis.forEach(function(e){s[e]=t[e]}),s},render:function(){var t=this.viewComponents[this.state.currentView],e=a.DOM,s="rdt",r=[];return this.props.input?r=[e.input(n({key:"i",type:"text",className:"form-control",onFocus:this.openCalendar,onChange:this.onChange,value:this.state.inputValue},this.props.inputProps))]:s+=" rdtStatic",this.state.open&&(s+=" rdtOpen"),e.div({className:s},r.concat(e.div({key:"dt",className:"rdtPicker"},a.createElement(t,this.getComponentProps()))))}});t.exports=l},function(t,e,s){"use strict";var n=s(2),a=n.DOM,r=n.createClass({renderYears:function(t){var e,s=[],n=-1,r=[];for(t--;11>n;)e="year",-1===n|10===n&&(e+=" old"),this.props.selectedDate.year()===t&&(e+=" active"),s.push(a.td({key:t,className:e,onClick:this.props.setDate("year")},t)),4==s.length&&(r.push(a.tr({key:n},s)),s=[]),t++,n++;return r},render:function(){var t=10*parseInt(this.props.viewDate.year()/10,10);return a.div({className:"rdtYears"},[a.table({key:"a"},a.thead({},a.tr({},[a.th({key:"prev",className:"prev"},a.button({onClick:this.props.subtractTime(10,"years")},"���")),a.th({key:"year",className:"switch",onClick:this.props.showView("years"),colSpan:2},t+"-"+(t+9)),a.th({key:"next",className:"next"},a.button({onClick:this.props.addTime(10,"years")},"���"))]))),a.table({key:"years"},a.tbody({},this.renderYears(t)))])}});t.exports=r},function(e,s){e.exports=t},function(t,e){"use strict";function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(t){var e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t))),e.filter(function(e){return a.call(t,e)})}var a=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var a,r,o=s(t),i=1;i<arguments.length;i++){a=arguments[i],r=n(Object(a));for(var c=0;c<r.length;c++)o[r[c]]=a[r[c]]}return o}},function(t,e,s){var n=s(2),a=s(5),r=n.DOM,o=n.createClass({render:function(){var t,e=this.renderFooter(),s=this.props.viewDate,n=s.localeData();return t=[r.thead({key:"th"},[r.tr({key:"h"},[r.th({key:"p",className:"prev"},r.button({onClick:this.props.subtractTime(1,"months")},"���")),r.th({key:"s",className:"switch",onClick:this.props.showView("months"),colSpan:5},n.months(s)+" "+s.year()),r.th({key:"n",className:"next"},r.button({onClick:this.props.addTime(1,"months")},"���"))]),r.tr({key:"d"},this.getDaysOfWeek(n).map(function(t){return r.th({key:t,className:"dow"},t)}))]),r.tbody({key:"tb"},this.renderDays())],e&&t.push(e),r.div({className:"rdtDays"},r.table({},t))},getDaysOfWeek:function(t){var e=t._weekdaysMin,s=t.firstDayOfWeek(),n=[],a=0;return e.forEach(function(t){n[(7+a++-s)%7]=t}),n},renderDays:function(){var t,e,s,n=this.props.viewDate,o=this.props.selectedDate,i=n.clone().subtract(1,"months"),c=n.year(),u=n.month(),d={y:o.year(),M:o.month(),d:o.date()},l=this.props.minDate,p=this.props.maxDate,h=[],m=[];i.date(i.daysInMonth()).startOf("week");for(var f=i.clone().add(42,"d");i.isBefore(f);)t="day",i.year()<c||i.month()<u?t+=" old":(i.year()>c||i.month()>u)&&(t+=" new"),i.isSame(d)&&(t+=" active"),i.isSame(a(),"day")&&(t+=" today"),e=l&&i.isBefore(l)||p&&i.isAfter(p),e&&(t+=" disabled"),s={key:i.format("M_D"),className:t},e||(s.onClick=this.props.updateDate),m.push(r.td(s,i.date())),7==m.length&&(h.push(r.tr({key:i.format("M_D")},m)),m=[]),i.add(1,"d");return h},renderFooter:function(){return this.props.timeFormat?r.tfoot({key:"tf"},r.tr({},r.td({onClick:this.props.showView("time"),colSpan:7,className:"timeToggle"},this.props.selectedDate.format(this.props.timeFormat)))):""}});t.exports=o},function(t,s){t.exports=e},function(t,e,s){"use strict";var n=s(2),a=(s(5),n.DOM),r=n.createClass({renderMonths:function(){for(var t,e=this.props.selectedDate,s=e.month(),n=e.localeData()._monthsShort,r=[],o=0,i=[];12>o;)t="month",o===s&&this.props.viewDate.year()===e.year()&&(t+=" active"),i.push(a.td({key:o,className:t,onClick:this.props.setDate("month")},n[o])),4==i.length&&(r.push(a.tr({key:s+"_"+r.length},i)),i=[]),o++;return r},render:function(){return a.div({className:"rdtMonths"},[a.table({key:"a"},a.thead({},a.tr({},[a.th({key:"prev",className:"prev"},a.button({onClick:this.props.subtractTime(1,"years")},"���")),a.th({key:"year",className:"switch",onClick:this.props.showView("years"),colSpan:2},this.props.viewDate.year()),a.th({key:"next",className:"next"},a.button({onClick:this.props.addTime(1,"years")},"���"))]))),a.table({key:"months"},a.tbody({key:"b"},this.renderMonths()))])}});t.exports=r},function(t,e,s){"use strict";var n=s(2),a=n.DOM,r=n.createClass({getInitialState:function(){var t=this.props.selectedDate,e=this.props.timeFormat,s=[];return(-1!=e.indexOf("H")||-1!=e.indexOf("h"))&&(s.push("hours"),-1!=e.indexOf("m")&&(s.push("minutes"),-1!=e.indexOf("s")&&s.push("seconds"))),{hours:t.format("H"),minutes:t.format("mm"),seconds:t.format("ss"),milliseconds:t.format("SSS"),counters:s}},renderCounter:function(t){return a.div({key:t,className:"rdtCounter"},[a.button({key:"up",className:"btn",onMouseDown:this.onStartClicking("increase",t)},"���"),a.div({key:"c",className:"rdtCount"},this.state[t]),a.button({key:"do",className:"btn",onMouseDown:this.onStartClicking("decrease",t)},"���")])},render:function(){var t=this,e=[];return this.state.counters.forEach(function(s){e.length&&e.push(a.div({key:"sep"+e.length,className:"rdtCounterSeparator"},":")),e.push(t.renderCounter(s))}),3==this.state.counters.length&&-1!=this.props.timeFormat.indexOf("S")&&(e.push(a.div({className:"rdtCounterSeparator",key:"sep5"},":")),e.push(a.div({className:"rdtCounter rdtMilli",key:"m"},a.input({value:this.state.milliseconds,type:"text",onChange:this.updateMilli})))),a.div({className:"rdtTime"},a.table({},[this.renderHeader(),a.tbody({key:"b"},a.tr({},a.td({},a.div({className:"rdtCounters"},e))))]))},updateMilli:function(t){var e=parseInt(t.target.value);e==t.target.value&&e>=0&&1e3>e&&(this.props.setTime("milliseconds",e),this.setState({milliseconds:e}))},renderHeader:function(){return this.props.dateFormat?a.thead({key:"h"},a.tr({},a.th({colSpan:4,onClick:this.props.showView("days")},this.props.selectedDate.format(this.props.dateFormat)))):""},onStartClicking:function(t,e){var s=this;return function(){var n={};n[e]=s[t](e),s.setState(n),s.timer=setTimeout(function(){s.increaseTimer=setInterval(function(){n[e]=s[t](e),s.setState(n)},80)},500),document.body.addEventListener("mouseup",function(){clearTimeout(s.timer),clearInterval(s.increaseTimer),s.props.setTime(e,s.state[e])})}},maxValues:{hours:23,minutes:59,seconds:59,milliseconds:999},padValues:{hours:1,minutes:2,seconds:2,milliseconds:3},increase:function(t){var e=parseInt(this.state[t])+1;return e>this.maxValues[t]&&(e=0),this.pad(t,e)},decrease:function(t){var e=parseInt(this.state[t])-1;return 0>e&&(e=this.maxValues[t]),this.pad(t,e)},pad:function(t,e){for(var s=e+"";s.length<this.padValues[t];)s="0"+s;return s}});t.exports=r},function(t,e,s){var n,a,r;!function(s,o){a=[],n=o,r="function"==typeof n?n.apply(e,a):n,!(void 0!==r&&(t.exports=r))}(this,function(){"use strict";var t=[],e=[],s="ignore-react-onclickoutside";return{componentDidMount:function(){if(!this.handleClickOutside)throw new Error("Component lacks a handleClickOutside(event) function for processing outside click events.");var n=this.__outsideClickHandler=function(t,e){return function(n){for(var a=n.target,r=!1;a.parentNode;){if(r=a===t||a.classList.contains(s))return;a=a.parentNode}e(n)}}(this.getDOMNode(),this.handleClickOutside),a=t.length;t.push(this),e[a]=n,this.props.disableOnClickOutside||this.enableOnClickOutside()},componentWillUnmount:function(){this.disableOnClickOutside(),this.__outsideClickHandler=!1;var s=t.indexOf(this);s>-1&&e[s]&&(e.splice(s,1),t.splice(s,1))},enableOnClickOutside:function(){var t=this.__outsideClickHandler;document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)},disableOnClickOutside:function(t){var t=this.__outsideClickHandler;document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}})}])});
\ No newline at end of file
diff --git a/package.json b/package.json
index 2141f20..5294f1c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "react-datetime",
-  "version": "0.2.0",
+  "version": "0.3.1",
   "description": "A lightweight but complete datetime picker React.js component.",
   "homepage": "https://github.com/arqex/react-datetime",
   "repository": {
diff --git a/src/DaysView.js b/src/DaysView.js
index 1b82ba1..744df10 100644
--- a/src/DaysView.js
+++ b/src/DaysView.js
@@ -15,9 +15,9 @@
 		tableChildren = [
 			DOM.thead({ key: 'th'}, [
 				DOM.tr({ key: 'h'},[
-					DOM.th({ key: 'p', className: 'prev', onClick: this.props.subtractTime(1, 'months') }, '���'),
+					DOM.th({ key: 'p', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'months')}, '���')),
 					DOM.th({ key: 's', className: 'switch', onClick: this.props.showView('months'), colSpan: 5 }, locale.months( date ) + ' ' + date.year() ),
-					DOM.th({ key: 'n', className: 'next', onClick: this.props.addTime(1, 'months')}, '���' )
+					DOM.th({ key: 'n', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'months')}, '���'))
 				]),
 				DOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day ){ return DOM.th({ key: day, className: 'dow'}, day ); }) )
 			]),
diff --git a/src/MonthsView.js b/src/MonthsView.js
index 1669f37..2f2b40c 100644
--- a/src/MonthsView.js
+++ b/src/MonthsView.js
@@ -36,9 +36,9 @@
 	render: function() {
 		return DOM.div({ className: 'rdtMonths' },[
 			DOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[
-				DOM.th({ key: 'prev', className: 'prev', onClick: this.props.subtractTime(1, 'years') }, '���'),
-				DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 5 }, this.props.viewDate.year() ),
-				DOM.th({ key: 'next', className: 'next', onClick: this.props.addTime(1, 'years')}, '���' )
+				DOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'years')}, '���')),
+				DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, this.props.viewDate.year() ),
+				DOM.th({ key: 'next', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'years')}, '���'))
 			]))),
 			DOM.table({ key: 'months'}, DOM.tbody({ key: 'b'}, this.renderMonths()))
 		]);
diff --git a/src/TimeView.js b/src/TimeView.js
index 83378d4..9b73f3a 100644
--- a/src/TimeView.js
+++ b/src/TimeView.js
@@ -30,9 +30,9 @@
 	},
 	renderCounter: function( type ){
 		return DOM.div({ key: type, className: 'rdtCounter'}, [
-			DOM.div({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '���' ),
+			DOM.button({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '���' ),
 			DOM.div({ key:'c', className: 'rdtCount' }, this.state[ type ] ),
-			DOM.div({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '���' )
+			DOM.button({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'decrease', type ) }, '���' )
 		]);
 	},
 	render: function() {
diff --git a/src/YearsView.js b/src/YearsView.js
index 250f5a4..8701aa1 100644
--- a/src/YearsView.js
+++ b/src/YearsView.js
@@ -36,9 +36,9 @@
 
 		return DOM.div({ className: 'rdtYears' },[
 			DOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[
-				DOM.th({ key: 'prev', className: 'prev', onClick: this.props.subtractTime(10, 'years') }, '���'),
-				DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 5 }, year + '-' + (year + 9) ),
-				DOM.th({ key: 'next', className: 'next', onClick: this.props.addTime(10, 'years')}, '���' )
+				DOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(10, 'years')}, '���')),
+				DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, year + '-' + (year + 9) ),
+				DOM.th({ key: 'next', className: 'next'}, DOM.button({onClick: this.props.addTime(10, 'years')}, '���'))
 				]))),
 			DOM.table({ key: 'years'}, DOM.tbody({}, this.renderYears( year )))
 		]);

--
Gitblit v1.9.3