Compare attributes of pairs with date algorithm.

        Shortcut of :class:`recordlinkage.compare.Date`::

            from recordlinkage.compare import Date

            indexer = recordlinkage.Compare()
            indexer.add(Date())
497778
def date(self, *args, **kwargs):
        
        compare = Date(*args, **kwargs)
        self.add(compare)

        return self
554587
public static int compareToDDMMYYYY(String date1, String date2) {
		if(date1.length()!=8 || date2.length()!=8) return 0;
		return compareToDDMMYYYY0(date1)-compareToDDMMYYYY0(date2);
	}
1051715
def _dates(p_word_before_cursor):
    
    to_absolute = lambda s: relative_date_to_date(s).isoformat()

    start_value_pos = p_word_before_cursor.find(':') + 1
    value = p_word_before_cursor[start_value_pos:]

    for reldate in date_suggestions():
        if not reldate.startswith(value):
            continue

        yield Completion(reldate, -len(value), display_meta=to_absolute(reldate))
261930
def _append_date(self, value, _file):  # pylint: disable=no-self-use
        
        _text = value.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
        _labs = ' "{text}"'.format(text=_text)
        _file.write(_labs)
1042766
def _get_edge_date(self, date_field, sort):
        '''
        
        '''
        return self._source.query(self._source_coll, {
                'q':'*:*',
                'rows':1,
                'fq':'+{}:*'.format(date_field),
                'sort':'{} {}'.format(date_field, sort)}).docs[0][date_field]
637953
def _insertDateIndex(date, l):
    '''
    
    '''
    return next((i for i, n in enumerate(l) if n[0] < date), len(l))
596804
def index(self, date):
        
        for (i, (start, end, ruler)) in enumerate(self.table):
            if start <= date.jd <= end:
                return i
        return None
643491
def _compare_records(src, sink, strict=False):
    # type: (MutableMapping[Text, Any], MutableMapping[Text, Any], bool) -> bool
    

    def _rec_fields(rec):  # type: (MutableMapping[Text, Any]) -> MutableMapping[Text, Any]
        out = {}
        for field in rec["fields"]:
            name = shortname(field["name"])
            out[name] = field["type"]
        return out

    srcfields = _rec_fields(src)
    sinkfields = _rec_fields(sink)
    for key in six.iterkeys(sinkfields):
        if (not can_assign_src_to_sink(
                srcfields.get(key, "null"), sinkfields.get(key, "null"), strict)
                and sinkfields.get(key) is not None):
            _logger.info("Record comparison failure for %s and %s\n"
                         "Did not match fields for %s: %s and %s",
                         src["name"], sink["name"], key, srcfields.get(key),
                         sinkfields.get(key))
            return False
    return True
1083260
@SuppressWarnings("unchecked")
    public T date( Date... date ) {
        if (checkIfNull(date)) {
            return (T) this;
        }
        date = ensureDateNotTimestamp(date);
        addObjectParameter(DATE_LIST, "date", date);
        return (T) this;
    }
541692
def format(self, date):
        
        context = {'date': date}
        for handler in self.format_chain:
            handler(self, date, context)
        return eval(self.format_code, globals(), context)
674751
def prettydate(date):
    now = datetime.now(timezone.utc)
    
    diff = now - date
    # Show the timestamp rather than the relative timeframe when the difference
    # is greater than 7 days
    if diff.days > 7:
        return date.strftime("%d. %b %Y")
    return arrow.get(date).humanize()
1249679
def dateRect( self, date ):
        
        data = self._dateGrid.get(date.toJulianDay())
        if ( data ):
            return QRectF(data[1])
        return QRectF()
722610
def similar_date(anon, obj, field, val):
    
    return anon.faker.date(field=field, val=val)
33380
def diff_in_days(date_to_compare)
      # d1 will be the earlier date, d2 the later
      if date_to_compare > self
        d1, d2 = dup, date_to_compare.dup
      elsif self > date_to_compare
        d1, d2 = date_to_compare.dup, dup
      else
        return 0  # same date
      end

      total = 0
      while d1.year != d2.year
        total += d1.days_left_in_year + 1 # need one extra day to push us to jan 1
        d1 = ZDate.new(ZDate.format_date(d1.year + 1))
      end
      total += d2.day_of_year - d1.day_of_year
      total
    end
93327
def _get_date_type(date):
        
        if isinstance(date, str):
            return 'str'

        if isinstance(date, datetime.date):
            return 'date'

        if isinstance(date, int):
            return 'int'

        raise ValueError('Unexpected type {0!s}'.format(date.__class__))
1148769
def delta(self, fromdate, todate):
        '''
        
        '''
#CONSIDER: raise an exception if a date is not in self
        return self.index(todate) - self.index(fromdate)
1290751
function(date) {
        var tooEarly = this.minDate && date < this.minDate,
            tooLate = this.maxDate && date > this.maxDate;

        if (this.method == 'between') {
            if (tooEarly)
                return true;
            if (tooLate)
                return false;
        } else if (this.method == 'before') {
            if (tooLate)
                return false;
        } else if (this.method == 'after') {
            if (tooEarly)
                return true;
            this.add(date);
            return false;
        }

        return this.add(date);

    }