def _release_threshold_select(self): return {0: "Don't ignore.", 1: format_timedelta(helper.releaseThresholdDelta[1], locale=common.getLocale()), 2: format_timedelta(helper.releaseThresholdDelta[2], locale=common.getLocale()), 3: format_timedelta(helper.releaseThresholdDelta[3], locale=common.getLocale()), 4: format_timedelta(helper.releaseThresholdDelta[4], locale=common.getLocale()), 5: format_timedelta(helper.releaseThresholdDelta[5], locale=common.getLocale()), 6: 'Completely ignore'}
def reltime(date): if date == common.FAKEDATE or not date: return "unknown" # FIXME use isinstance() ... but test it if type(date).__name__ not in ('date', 'datetime'): return "reltime needs a date or datetime we got: '%s'" % repr(date) return format_timedelta(date - datetime.now(), locale=common.getLocale(), add_direction=True)
def _release_threshold_select(self): return { 0: "Don't ignore.", 1: format_timedelta(helper.releaseThresholdDelta[1], locale=common.getLocale()), 2: format_timedelta(helper.releaseThresholdDelta[2], locale=common.getLocale()), 3: format_timedelta(helper.releaseThresholdDelta[3], locale=common.getLocale()), 4: format_timedelta(helper.releaseThresholdDelta[4], locale=common.getLocale()), 5: format_timedelta(helper.releaseThresholdDelta[5], locale=common.getLocale()), 6: 'Completely ignore' }
def reltime(date): if type(date).__name__ not in ('date', 'datetime'): return "reltime needs a date or datetime we got: '%s'" % repr(date) _now = datetime.now() return format_timedelta(date - _now, locale=common.getLocale())
def reltime(date): if date == common.FAKEDATE: return "unknown" if type(date).__name__ not in ('date', 'datetime'): return "reltime needs a date or datetime we got: '%s'" % repr(date) return format_timedelta(date - datetime.now(), locale=common.getLocale())