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
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
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