def display_timesince(date, double=False):
    """ 
    Format date for messages create_on: show a relative time
    with contextual helper to show fulltime format.
    """
    if not date:
        return 'Never'
    date_rel = timesince(date)
    if not double:
        date_rel = date_rel.split(',')[0]
    date_rel += ' ago'
    date_abs = date.strftime("%Y-%m-%d %H:%M:%S %Z")
    return mark_safe("<span title='%s'>%s</span>" % (date_abs, date_rel))
def display_timesince(date, double=False):
    """ 
    Format date for messages create_on: show a relative time
    with contextual helper to show fulltime format.
    """
    if not date:
        return 'Never'
    date_rel = timesince(date)
    if not double:
        date_rel = date_rel.split(',')[0]
    date_rel += ' ago'
    date_abs = date.strftime("%Y-%m-%d %H:%M:%S %Z")
    return mark_safe("<span title='%s'>%s</span>" % (date_abs, date_rel))
 def display_end_date(self, instance):
     time = instance.end.strftime('%b. %d, %Y, %I:%M %P')
     time_since = timesince(instance.end)
     return mark_safe('<span title="%s ago">%s</span>' % (time_since, time))
Exemple #4
0
 def display_end_date(self, instance):
     time = instance.end.strftime('%b. %d, %Y, %I:%M %P')
     time_since = timesince(instance.end)
     return mark_safe('<span title="%s ago">%s</span>' % (time_since, time))