|
1 | 1 | 'use strict';
|
2 | 2 |
|
| 3 | +require('classlist-polyfill'); |
| 4 | + |
3 | 5 | var assign = require('object-assign'),
|
4 | 6 | React = require('react'),
|
5 | 7 | DaysView = require('./src/DaysView'),
|
@@ -36,6 +38,7 @@ var Datetime = React.createClass({
|
36 | 38 | getDefaultProps: function() {
|
37 | 39 |
|
38 | 40 | return {
|
| 41 | + className: 'form-control', |
39 | 42 | date: new Date(),
|
40 | 43 | viewMode: 'days',
|
41 | 44 | inputProps: {},
|
@@ -141,7 +144,7 @@ var Datetime = React.createClass({
|
141 | 144 | ;
|
142 | 145 | return function( e ){
|
143 | 146 | me.setState({
|
144 |
| - viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.dataset.value) ).startOf( type ), |
| 147 | + viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value')) ).startOf( type ), |
145 | 148 | currentView: nextViews[ type ]
|
146 | 149 | });
|
147 | 150 | };
|
@@ -208,7 +211,7 @@ var Datetime = React.createClass({
|
208 | 211 |
|
209 | 212 | date = this.state.viewDate.clone()
|
210 | 213 | .month( this.state.viewDate.month() + modifier )
|
211 |
| - .date( parseInt( target.dataset.value ) ) |
| 214 | + .date( parseInt( target.getAttribute('data-value') ) ) |
212 | 215 | .hours( currentDate.hours() )
|
213 | 216 | .minutes( currentDate.minutes() )
|
214 | 217 | .seconds( currentDate.seconds() )
|
@@ -275,7 +278,7 @@ var Datetime = React.createClass({
|
275 | 278 | children = [ DOM.input( assign({
|
276 | 279 | key: 'i',
|
277 | 280 | type:'text',
|
278 |
| - className:'form-control', |
| 281 | + className: 'form-control', |
279 | 282 | onFocus: this.openCalendar,
|
280 | 283 | onChange: this.onChange,
|
281 | 284 | value: this.state.inputValue
|
|
0 commit comments