Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/arqex/react-datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
arqex committed Jul 14, 2015
2 parents cc4ddac + f32ed18 commit 907c50f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions DateTime.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

require('classlist-polyfill');

var assign = require('object-assign'),
React = require('react'),
DaysView = require('./src/DaysView'),
Expand Down Expand Up @@ -36,6 +38,7 @@ var Datetime = React.createClass({
getDefaultProps: function() {
var nof = function(){};
return {
className: 'form-control',
date: new Date(),
viewMode: 'days',
inputProps: {},
Expand Down Expand Up @@ -139,7 +142,7 @@ var Datetime = React.createClass({
;
return function( e ){
me.setState({
viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.dataset.value) ).startOf( type ),
viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value')) ).startOf( type ),
currentView: nextViews[ type ]
});
};
Expand Down Expand Up @@ -204,7 +207,7 @@ var Datetime = React.createClass({

date = this.state.viewDate.clone()
.month( this.state.viewDate.month() + modifier )
.date( parseInt( target.dataset.value ) )
.date( parseInt( target.getAttribute('data-value') ) )
.hours( currentDate.hours() )
.minutes( currentDate.minutes() )
.seconds( currentDate.seconds() )
Expand Down Expand Up @@ -273,7 +276,7 @@ var Datetime = React.createClass({
children = [ DOM.input( assign({
key: 'i',
type:'text',
className:'form-control',
className: 'form-control',
onFocus: this.openCalendar,
onChange: this.onChange,
value: this.state.inputValue
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"webpack-dev-server": "^1.7.0"
},
"dependencies": {
"classlist-polyfill": "^1.0.1",
"object-assign": "^3.0.0",
"react-onclickoutside": "^0.2.4"
}
Expand Down

0 comments on commit 907c50f

Please sign in to comment.