def when_text(d, t=None): """Return a string with a concise representation of the given date and time combination. Examples: >>> print(when_text(datetime.date(2013,12,25))) Wed 25/12/2013 >>> print(when_text( ... datetime.date(2013,12,25), datetime.time(17,15,00))) Wed 25/12/2013 (17:15) >>> print(when_text(None)) <BLANKLINE> """ if d is None: return '' # fmt = 'yyyy MMM dd (EE)' # txt = d.strftime(settings.SITE.date_format_strftime) txt = format_date(d, 'EE ') txt += fds(d) if t is not None: txt += ' (%s)' % t.strftime(settings.SITE.time_format_strftime) return txt
def fmt(obj): s = E.tostring(ar.action_button(ba, obj)) s += fds(obj.created) + " " + obj.created.strftime( settings.SITE.time_format_strftime) + " " s += ar.parse_memo(obj.body) # s += obj.body return "<li>{}</li>".format(s)
def statements(self, ar): if ar is None or not dd.is_installed('b2c'): return '' Account = rt.models.b2c.Account try: b2c = Account.objects.get(iban=self.iban) except Account.DoesNotExist: return '' return ar.obj2html(b2c, fds(b2c.last_transaction))
def statements(self, ar): if ar is None or not dd.is_installed('b2c'): return '' Account = rt.modules.b2c.Account try: b2c = Account.objects.get(iban=self.iban) except Account.DoesNotExist: return '' return ar.obj2html(b2c, fds(b2c.last_transaction))
def fmt(obj): s = tostring(ar.action_button(ba, obj)) s += fds(obj.created) + " " + obj.created.strftime( settings.SITE.time_format_strftime) + " " if obj.body: s += ar.parse_memo(obj.body) else: s += ar.parse_memo(obj.subject) e = etree.parse(StringIO(s), html_parser) return E.li(E.div(*e.iter()))
def format_value(self, ar, v): """Return a plain textual representation of this value as a unicode string. """ return fds(v)
def rangefmt(r): return fds(r[0]) + '...' + fds(r[1])
def daterange_text(a, b): """ """ if a == b: return fds(a) return fds(a) + "-" + fds(b)
def fmt(obj): s = E.tostring(ar.action_button(ba, obj)) s += fds(obj.created) + " " + obj.created.strftime( settings.SITE.time_format_strftime) + " " s += obj.body return "<li>{}</li>".format(s)