|
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 | var nof = function(){};
|
38 | 40 | return {
|
| 41 | + className: 'form-control', |
39 | 42 | date: new Date(),
|
40 | 43 | viewMode: 'days',
|
41 | 44 | inputProps: {},
|
@@ -139,7 +142,7 @@ var Datetime = React.createClass({
|
139 | 142 | ;
|
140 | 143 | return function( e ){
|
141 | 144 | me.setState({
|
142 |
| - viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.dataset.value) ).startOf( type ), |
| 145 | + viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value')) ).startOf( type ), |
143 | 146 | currentView: nextViews[ type ]
|
144 | 147 | });
|
145 | 148 | };
|
@@ -204,7 +207,7 @@ var Datetime = React.createClass({
|
204 | 207 |
|
205 | 208 | date = this.state.viewDate.clone()
|
206 | 209 | .month( this.state.viewDate.month() + modifier )
|
207 |
| - .date( parseInt( target.dataset.value ) ) |
| 210 | + .date( parseInt( target.getAttribute('data-value') ) ) |
208 | 211 | .hours( currentDate.hours() )
|
209 | 212 | .minutes( currentDate.minutes() )
|
210 | 213 | .seconds( currentDate.seconds() )
|
@@ -273,7 +276,7 @@ var Datetime = React.createClass({
|
273 | 276 | children = [ DOM.input( assign({
|
274 | 277 | key: 'i',
|
275 | 278 | type:'text',
|
276 |
| - className:'form-control', |
| 279 | + className: 'form-control', |
277 | 280 | onFocus: this.openCalendar,
|
278 | 281 | onChange: this.onChange,
|
279 | 282 | value: this.state.inputValue
|
|
0 commit comments