Skip to content

Commit

Permalink
Remove usage of experimental 'includes' function
Browse files Browse the repository at this point in the history
The string prototype function 'includes' is part of ES6 and does not work
in Firefox 38. This simple change seems to fix it.
  • Loading branch information
torarvid committed Jun 1, 2015
1 parent 62c5707 commit 403fdb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DateTimeField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ DateTimeField = React.createClass({
var target = e.target;
if (target.className && !target.className.match(/disabled/g)) {
var month;
if(target.className.includes("new")) month = this.state.viewDate.month() + 1;
else if(target.className.includes("old")) month = this.state.viewDate.month() - 1;
if(target.className.indexOf("new") >= 0) month = this.state.viewDate.month() + 1;
else if(target.className.indexOf("old") >= 0) month = this.state.viewDate.month() - 1;
else month = this.state.viewDate.month();
return this.setState({
selectedDate: this.state.viewDate.clone().month(month).date(parseInt(e.target.innerHTML)).hour(this.state.selectedDate.hours()).minute(this.state.selectedDate.minutes())
Expand Down

0 comments on commit 403fdb1

Please sign in to comment.