Tor Arvid Lund
2015-06-01 403fdb1009e7cab01228da5b2e639862c2d5abd2
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.
1 files modified
4 ■■■■ changed files
src/DateTimeField.jsx 4 ●●●● patch | view | raw | blame | history
src/DateTimeField.jsx
@@ -97,8 +97,8 @@
    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())