Example #1
0
def parse(subject, value, red):
    try:
        date = rh.parse_date(value)
    except ValueError:
        red.set_message(subject, rs.BAD_DATE_SYNTAX)
        return None
    return date
Example #2
0
def parse(subject, value, red):
    try:
        date = rh.parse_date(value)
    except ValueError:
        red.set_message(subject, rs.BAD_DATE_SYNTAX)
        return None
    return date
Example #3
0
def parse(subject, value, red):
    try:
        date = rh.parse_date(value)
    except ValueError:
        red.set_message(subject, rs.BAD_DATE_SYNTAX)
        return None
    if date > red.res_ts:
        red.set_message(subject, rs.LM_FUTURE)
        return date
    else:
        red.set_message(subject, rs.LM_PRESENT,
          last_modified_string=rh.relative_time(date, red.res_ts))
    return date
Example #4
0
def parse(subject, value, red):
    try:
        date = rh.parse_date(value)
    except ValueError:
        red.set_message(subject, rs.BAD_DATE_SYNTAX)
        return None
    if date > red.res_ts:
        red.set_message(subject, rs.LM_FUTURE)
        return date
    else:
        red.set_message(subject,
                        rs.LM_PRESENT,
                        last_modified_string=rh.relative_time(
                            date, red.res_ts))
    return date