判断是否是实验生效状态

@param {Date|stirng|number} start 开始时间
@param {Date|stirng|number} end 结束事件
@returns {boolean} 当前时间是否生效的结果
160421
function isTimeInRange (start, end) {
  let expStartTime = (new Date(start || Date.now())).getTime()
  let expEndTime = (new Date(end || '2099-01-01')).getTime()
  let nowTime = Date.now()

  // 如果实验生效时间配置错误
  if (!expStartTime || !expEndTime || expStartTime > expEndTime) {
    return false
  }

  return nowTime >= expStartTime && nowTime <= expEndTime
}
659515
function startOfYear() {
      var result = this.clone();
      result.day = 1;
      result.month = 1;
      result.isDate = true;
      result.hour = 0;
      result.minute = 0;
      result.second = 0;
      return result;
    }
995593
function time( start, end ) {
	var arr;
	var i;

	// Convert start and end times to JavaScript timestamps..
	start = ( new Date( start ) ).getTime();
	end = ( new Date( end ) ).getTime();

	// Add <1 day to ensure end time is included in time vector:
	end += 43200000; // half day [ms]

	// Create a linearly spaced date vector:
	arr = incrdatespace( start, end, 'day' );

	// Convert all date objects to JavaScript timestamps...
	for ( i = 0; i < arr.length; i++ ) {
		arr[ i ] = arr[ i ].getTime();
	}
	return arr;
}
873280
function ender(input) {
  return signal(function(next) {
    var pending = 0
    var state = null
    return spawn(input, function(item) {
      state = item === START ? (pending = pending + 1,
                                state) :
              item === END ? (pending = pending - 1,
                              pending ? state : next(item)) :
              next(item)
      return state
    })
  })
}
195018
function(){
            var self = this,
                startTime = null,
                stopTime = null,
                times = [];
            var isSet = function(prop){
                return (prop==null)?false:true;
            };
            var isStarted = function(){
                return isSet(startTime);
            };
            var isStopped = function(){
                return isSet(stopTime);
            };
            var softReset = function(){
                startTime = null;
                stopTime = null;
            };
            self.start = function(){
                if(isStarted()){
                   throw new Error("cannot call start, start already invoked.");
                }
                startTime = new Date();
            };
            self.stop = function(){
               if(!isStarted()){
                   throw new Error("cannot call stop, start not invoked.");
               }
               if(isStopped()){
                   throw new Error("cannot call stop, stop already invoked.");
               }
               stopTime = new Date();
               time = stopTime - startTime;
               times.push(time);
            };
            self.pause = function(){
                if(!isStarted()){
                   throw new Error("cannot call pause, start not invoked.");
                }
                if(isStopped()){
                   throw new Error("cannot call pause, stop already invoked.");
                }
                self.stop();
                softReset();
            };
            self.reset = function(){
                softReset();
                times = [];
            };
            self.time = function(){
                var total = 0;
                for(i=0; i<times.length; i++){
                    total += times[i];
                }
                if(isStarted() && !isStopped()){
                    total += (new Date() - startTime);
                }
                return total/1000;
            };
        }
53182
public boolean evaluateSprintLength(String startDate, String endDate, int maxKanbanIterationLength) {
		boolean sprintIndicator = false;
		Calendar startCalendar = Calendar.getInstance();
		Calendar endCalendar = Calendar.getInstance();

		if (!StringUtils.isAnyEmpty(startDate) && !StringUtils.isAnyEmpty(endDate)) {

			Date strDt = convertIntoDate(startDate.substring(0, 4) + "-" + startDate.substring(5, 7) + "-" + startDate.substring(8, 10), "yyyy-MM-dd" );
			Date endDt = convertIntoDate(endDate.substring(0, 4) + "-" + endDate.substring(5, 7) + "-" + endDate.substring(8, 10), "yyyy-MM-dd");

			if (strDt != null && endDate != null) {
				startCalendar.setTime(strDt);
				endCalendar.setTime(endDt);

				long diffMill = endCalendar.getTimeInMillis() - startCalendar.getTimeInMillis();
				long diffDays = TimeUnit.DAYS.convert(diffMill, TimeUnit.MILLISECONDS);

				if (diffDays <= maxKanbanIterationLength) {
					// Scrum-enough
					sprintIndicator = true;
				}
			}
		} else {
			// Default to kanban
			sprintIndicator = false;

		}

		return sprintIndicator;
	}
603659
function endOfMonth() {
      var result = this.clone();
      result.day = ICAL.Time.daysInMonth(result.month, result.year);
      result.isDate = true;
      result.hour = 0;
      result.minute = 0;
      result.second = 0;
      return result;
    }
1219743
function randTime (startTime, endTime) {
  let secStart = new Date(startTime).getTime() / 1000
  let secDiff = 0
  if (secStart < 0) {
    secDiff = new Date(endTime) / 1000 + Math.abs(secStart)
  } else {
    secDiff = ~~((new Date(endTime) - new Date(startTime)) / 1000)
  }
  let randSec = tools.rnd(0, secDiff)
  let resultSec = (new Date(startTime)).getTime() + randSec * 1000
  return new Date(resultSec).date2Str()
}
96353
function(start, value, type) {
			var obj = {
				start: start || 0,
				value: value || '',
				type: type
			};
			
			obj.end = obj.start + obj.value.length;
			return obj;
		}
313909
function (start, end) {
    var offsetStart;
    var offsetEnd;

    loadBufferIfRequired(start, end);

    offsetStart = start - currentRange.start;
    offsetEnd = offsetStart + (end - start);

    return buffer.slice(offsetStart, offsetEnd);
  }
488999
public boolean hasSpansIntersecting(int start, int end) {
        for (int i = 0; i < numberOfSpans; i++) {
            // equal test is valid since both intervals are not empty by construction
            if (spanStarts[i] >= end || spanEnds[i] <= start) continue;
            return true;
        }
        return false;
    }
453952
function getExpressions(ast, start, end) {
        var expns = [],
            s     = start,
            e     = end,
            expn;

        while (true) {
            expn = RefactoringUtils.findSurroundExpression(ast, {start: s, end: e});
            if (!expn) {
                break;
            }
            expns.push(expn);
            s = expn.start - 1;
        }

        s = start;
        e = end;

        function checkExpnEquality(e) {
            return e.start === expn.start && e.end === expn.end;
        }

        while (true) {
            expn = RefactoringUtils.findSurroundExpression(ast, {start: s, end: e});
            if (!expn) {
                break;
            }
            e = expn.end + 1;

            // if expn already added, continue
            if (expns.find(checkExpnEquality)) {
                 continue;
            }

            expns.push(expn);
        }

        return expns;
    }
496886
function(str, start) {
    return (str.length >= start.length &&
            str.substr(0, start.length) === start);
  }
433458
public TimerType<T> end(java.util.Date end)
   {
      if (end != null)
      {
         childNode.getOrCreate("end").text(XMLDate.toXMLFormat(end));
         return this;
      }
      return null;
   }
34012
public static Date getRandomDate(Date begin, Date end) {
		return getRandomDate(begin, end, r);
	}
1350088
public static boolean isBetween(@NotNull final Date date, @NotNull final Date start, @NotNull final Date end) {
		if (date == null || start == null || end == null || start.after(end)) {
			throw new IllegalArgumentException("some date parameters is null or dateBein after dateEnd");
		}
		return !date.before(start) && !date.after(end);
	}
228925
function generateNumber(beginValue, endValue, duration, easing, interval){
  verifyParams(duration, interval)
  const count = duration / interval
  const times = endValue - beginValue
  const numbers = generate(easing, count, times).map(number => (number + beginValue).toFixed(4))
  return numbers
}