Return a new date with new values for the specified fields.
960033
def replace(self, year=None, month=None, day=None):
        """"""
        if year is None:
            year = self._year
        if month is None:
            month = self._month
        if day is None:
            day = self._day
        _check_date_fields(year, month, day)
        return date(year, month, day)
84850
def date_added(self, date_added):
        """"""
        self._group_data['dateAdded'] = self._utils.format_datetime(
            date_added, date_format='%Y-%m-%dT%H:%M:%SZ'
        )
1065370
function filter_date(value) {
    var m = DATE_RE.exec(value);
    if(m == null) throw OptError('Expected a date representation in the "yyyy-mm-dd" format.');
    return new Date(parseInt(m[0]), parseInt(m[1]), parseInt(m[2]));
}
1080671
public void addDocument(String... fields){
        for (int i = 0; i < fields.length; i++) {
            final DataType type = schema.getType(i);
            String field = fields[i];
            final Map<String, Set<Integer>> stringSetMap = this.fields.get(i);
            if(type == DataType.DateYear){ // reformat field value for date year
                 field = field.split("-")[0];
            }
            Set<Integer> integers = stringSetMap.get(field);
            if(integers == null){
                integers = new TreeSet<>();
            }
            integers.add(docPosition);
            stringSetMap.put(field, integers);
        }
        docPosition++;
    }
282849
function isLeap (date) {
  var year;
  if (typeof date === 'number') {
    year = date;
  } else {
    date = this.toDate(date);
    year = date.getFullYear();
  }
  return new Date(year, 1, 29).getDate() === 29;
}
159053
def update(self, _values=None, **values):
        
        if _values is not None:
            values.update(_values)

        return self._query.update(self._add_updated_at_column(values))
691264
public DateTime setField(int field, int value) {
		final Calendar calendar = toCalendar();
		calendar.set(field, value);

		DateTime dt = this;
		if (false == mutable) {
			dt = ObjectUtil.clone(this);
		}
		return dt.setTimeInternal(calendar.getTimeInMillis());
	}
705542
public static Date newDate(final Date original) {
        return original != null ? new Date(original.getTime()) : null;
    }
559392
function(inst) {
		var altFormat, date, dateStr,
			altField = this._get(inst, "altField");

		if (altField) { // update alternate field too
			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
			date = this._getDate(inst);
			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
			$(altField).each(function() { $(this).val(dateStr); });
		}
	}
728542
def update_field(self, name, value):
        
        kwargs = {}
        kwargs['field.' + name] = value
        return self.post(**kwargs)
718574
def update(table, field, value, **kwargs):
    

    return convert(table, field, lambda v: value, **kwargs)
1353063
def insert(self, fields, values):
        '''
        
        '''
        if fields:
            _fields = ' (%s) ' % ','.join(fields)
        else:
            _fields = ''
        _values = ','.join('?' * len(values))
        query = '''
        INSERT INTO %s %s VALUES (%s)
        ''' % (self._name, _fields, _values)
        self._cursor.execute(query, tuple(values))
        self._connection.commit()
        return self._cursor.lastrowid
176986
def update_fields_values(params)
      params || return

      fields.each {|f| f.find_or_create_type_object(self).tap {|t| t || next
        params[f.code_name.to_sym].tap {|v| v && t.value = v}
        t.save }}
    end
605772
def create(self, **fields):
        """"""
        entry = self.instance(**fields)
        entry.save()
        return entry
1036313
function incrementDays(date, numberOfDays) {
      return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays);
    }
1306694
function coerceDate(value) {
    if (value instanceof Date) {
        return value;
    }

    let timestamp = Date.parse(value);

    if (!isNaN(timestamp)) {
        return new Date(timestamp);
    }

    return value;
}
255696
def add_date(self, date):
        
        self.lines = self.parser.add_date(date, self.lines)