From 403fdb1009e7cab01228da5b2e639862c2d5abd2 Mon Sep 17 00:00:00 2001 From: Tor Arvid Lund Date: Mon, 1 Jun 2015 16:24:33 +0200 Subject: [PATCH] Remove usage of experimental 'includes' function The string prototype function 'includes' is part of ES6 and does not work in Firefox 38. This simple change seems to fix it. --- src/DateTimeField.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DateTimeField.jsx b/src/DateTimeField.jsx index 71eccd92f..a32d2ec82 100644 --- a/src/DateTimeField.jsx +++ b/src/DateTimeField.jsx @@ -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())