from datetime import datetime


def fmt_timestamp(ts=None):
    """
    Jinja filter to format date/time from timestamp.
    """

    if ts is None:
        return 'no-timestamp'
    dt = datetime.fromtimestamp(int(ts))
    pretty_time = dt.strftime('%m/%d/%y %I:%M %p')
    return pretty_time