Add time for each dates specified
509954
function addTime(options, client) {
    return function(next, project) {
        var dates = options.dates;
        delete options.dates;
        var join = futures.join();
        join.add(dates.map(function(date) {
            var promise = futures.future();
            // we must clone to prevent options.date override
            var opts = utils.clone(options);
            opts.date = date;
            var message = ('Save '+ opts.time + ' ' +
                           (opts.billable ? 'billable' : 'non billable') +
                           ' hours for '+ opts.date);
            intervals.addTime(project, opts, client, function (err, res) {
                var msg = 'OK';
                if (err) { msg = 'ERROR'; console.error(err); }
                else if (res.status != 201) { msg = 'ERROR'; console.error('Unexpected status '+ res.status +' for addTime method'); };
                console.log(message + ' ' + msg);
                promise.deliver();
            });
            return promise;
        }));
        join.when(function() {
            next(project);
        });
    };
}
731678
function dateAdd (date, interval, units) {
  let result = new Date(date)

  switch (interval.toLowerCase()) {
    case 'year':
      result.setFullYear(result.getFullYear() + units)
      break
    case 'quarter':
      result.setMonth(result.getMonth() + 3 * units)
      break
    case 'month':
      result.setMonth(result.getMonth() + units)
      break
    case 'week':
      result.setDate(result.getDate() + 7 * units)
      break
    case 'day':
      result.setDate(result.getDate() + units)
      break
    case 'hour':
      result.setTime(result.getTime() + units * 3600000)
      break
    case 'minute':
      result.setTime(result.getTime() + units * 60000)
      break
    case 'second':
      result.setTime(result.getTime() + units * 1000)
      break
    default:
      result = undefined
      break
  }
  return result
}
854089
public static Date addMinute(Date date, int amount) {
        return add(date, Calendar.MINUTE, amount);
    }
727337
def _calculate_timestamps(self):
        """"""
        self._timestamps_data = []
        if not self._is_reversed:
            self._calc_timestamps(self.st_time, self.end_time)
        else:
            self._calc_timestamps(self.st_time, DateTime.from_hoy(8759))
            self._calc_timestamps(DateTime.from_hoy(0), self.end_time)
351862
def merge_datetime(date, time='', date_format='%d/%m/%Y', time_format='%H:%M'):
    """"""
    day = datetime.strptime(date, date_format)
    if time:
        time = datetime.strptime(time, time_format)
        time = datetime.time(time)
        day = datetime.date(day)
        day = datetime.combine(day, time)
    return day
858672
def add_hours(self, datetimestr, n):
        
        a_datetime = self.parse_datetime(datetimestr)
        return a_datetime + timedelta(seconds=3600 * n)
486518
public static Date addHours(Date d, int hours) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(d);
        cal.add(Calendar.HOUR_OF_DAY, hours);
        return cal.getTime();
    }
1067604
def _to_desired_dates(self, arr):
        """"""
        times = utils.times.extract_months(
            arr[internal_names.TIME_STR], self.months
        )
        return arr.sel(time=times)
397187
async def dateadd(request, value, addend, unit):
    """"""
    value = value or dt.datetime.utcnow()
    if unit == "minutes":
        delta = dt.timedelta(minutes=addend)
    else:
        delta = dt.timedelta(days=addend)
    result = value + delta
    return json_response({"result": result.isoformat()})
588211
def add_time_labels(self):
        """"""
        for text, pos in zip(self.idx_time, self.time_pos):
            self.scene.addItem(text)
            text.setPos(pos)
1154455
function (date) {
            this.minHours = date.getHours();
            this.minMinutes = date.getMinutes();

            // If, for example, min hours are 10, and current hours are 12,
            // update minMinutes to default value, to be able to choose whole range of values
            if (this.d.lastSelectedDate) {
                if (this.d.lastSelectedDate.getHours() > date.getHours()) {
                    this.minMinutes = this.opts.minMinutes;
                }
            }
        }
1163058
def dateadd(value: fields.DateTime(),
            addend: fields.Int(validate=Range(min=1)),
            unit: fields.Str(validate=OneOf(['minutes', 'days']))='days'):
    """"""
    value = value or dt.datetime.utcnow()
    if unit == 'minutes':
        delta = dt.timedelta(minutes=addend)
    else:
        delta = dt.timedelta(days=addend)
    result = value + delta
    return {'result': result}
142479
def time_from_date(date)
			numbers=date.scan(/\d+/).map!{|i| i.to_i}
			day=numbers[2-numbers.index(numbers.max)]
			Date.new(numbers.max,numbers[1],day).to_time 
		end
291173
async def on_date(self, date: datetime.date) -> dict:
        """"""
        return await self._request(
            'get', 'dailystats/{0}'.format(date.strftime('%Y-%m-%d')))
432917
private void set_time()
	{
		if (date == true)
		{		
			Date d = new Date();
			
			long nb_millisec = d.getTime();
	
			when.tv_sec = (int)(nb_millisec / 1000);
			when.tv_usec = (int)((nb_millisec - (when.tv_sec * 1000)) * 1000);
			when.tv_nsec = 0;
		}
	}
74666
def _update_time(self):
        
        self.time['steps'] += 1
        # time in days since beginning
        self.time['days_elapsed'] += self.time['timestep'] / const.seconds_per_day
        if self.time['day_of_year_index'] >= self.time['num_steps_per_year']-1:
            self._do_new_calendar_year()
        else:
            self.time['day_of_year_index'] += 1
998385
def addToTimeInv(self,*params):
        '''
        
        '''
        for param in params:
            if param not in self.time_inv:
                self.time_inv.append(param)