Skip to content

Commit 057da79

Browse files
committed
Merge pull request quri#56 from torarvid/remove-includes
Remove usage of experimental 'includes' function
2 parents 62c5707 + 403fdb1 commit 057da79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DateTimeField.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ DateTimeField = React.createClass({
9797
var target = e.target;
9898
if (target.className && !target.className.match(/disabled/g)) {
9999
var month;
100-
if(target.className.includes("new")) month = this.state.viewDate.month() + 1;
101-
else if(target.className.includes("old")) month = this.state.viewDate.month() - 1;
100+
if(target.className.indexOf("new") >= 0) month = this.state.viewDate.month() + 1;
101+
else if(target.className.indexOf("old") >= 0) month = this.state.viewDate.month() - 1;
102102
else month = this.state.viewDate.month();
103103
return this.setState({
104104
selectedDate: this.state.viewDate.clone().month(month).date(parseInt(e.target.innerHTML)).hour(this.state.selectedDate.hours()).minute(this.state.selectedDate.minutes())

0 commit comments

Comments
 (0)