code: function (range) {
          var coeff = 1000 * 60 * range;
          return new Date(Math.ceil(new Date(Date.now()).getTime() / coeff) * coeff).getTime() / 1000;
      }
docs: Calculate current time interval slot