Loïc CHOLLIER
2015-06-02 057da79cfcab4c63c08a3e144900308c992e3882
Merge pull request #56 from torarvid/remove-includes

Remove usage of experimental 'includes' function
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())