mezzanine_events/utils.py
def duration_info(start, end=None):
    """
    Human readable representation of a time interval.
    """
    if not isinstance(start, datetime):
        return ""

    local_start = localtime(start)
    out = datefmt(local_start, "DATETIME_FORMAT")
    if end not in (None, start):
        local_end = localtime(end)
        if local_end.date() == local_start.date():
            out += " to {}".format(datefmt(local_end, "TIME_FORMAT"))
        else:
            out += " to {}".format(datefmt(local_end, "DATETIME_FORMAT"))
    return out

    Human readable representation of a time interval.
    
Human readable representation of a time interval.
Human readable representation of a time interval .
def duration_info(start, end=None):
    if not isinstance(start, datetime):
        return ""
    local_start = localtime(start)
    out = datefmt(local_start, "DATETIME_FORMAT")
    if end not in (None, start):
        local_end = localtime(end)
        if local_end.date() == local_start.date():
            out += " to {}".format(datefmt(local_end, "TIME_FORMAT"))
        else:
            out += " to {}".format(datefmt(local_end, "DATETIME_FORMAT"))
    return out
def duration_info ( start , end = None ) : if not isinstance ( start , datetime ) : return "" local_start = localtime ( start ) out = datefmt ( local_start , "DATETIME_FORMAT" ) if end not in ( None , start ) : local_end = localtime ( end ) if local_end . date ( ) == local_start . date ( ) : out += " to {}" . format ( datefmt ( local_end , "TIME_FORMAT" ) ) else : out += " to {}" . format ( datefmt ( local_end , "DATETIME_FORMAT" ) ) return out
Human readable representation of a time interval.
Human readable representation of a time interval .
"""
    Human readable representation of a time interval.
    """
start
end