def daterange(value, details=False):
    '''Display a date range in the shorter possible maner.'''
    if not isinstance(value, db.DateRange):
        raise ValueError('daterange only accept db.DateRange as parameter')

    if details:
        return daterange_with_details(value)

    date_format = 'YYYY'

    delta = value.end - value.start
    start, end = None, None
    start = format_date(value.start, date_format)
    if delta.days > 365:
        end = format_date(value.end, date_format)

    return '{start!s}–{end!s}'.format(start=start, end=end) if end else start
Display a date range in the shorter possible maner.