fix pretty_datetime helper
This commit is contained in:
parent
2685759932
commit
c788601572
1 changed files with 2 additions and 2 deletions
|
@ -37,9 +37,9 @@ from webhelpers.html.tags import literal
|
|||
import formalchemy
|
||||
from formalchemy.validators import accepts_none
|
||||
|
||||
import edbob
|
||||
from edbob.lib import pretty
|
||||
from edbob.pyramid import Session, helpers
|
||||
from edbob.time import localize
|
||||
|
||||
from edbob.pyramid.forms.formalchemy.fieldset import *
|
||||
from edbob.pyramid.forms.formalchemy.grid import *
|
||||
|
@ -114,7 +114,7 @@ def pretty_datetime(value, from_='local', to='local'):
|
|||
if not isinstance(value, datetime.datetime):
|
||||
return str(value) if value else ''
|
||||
if not value.tzinfo:
|
||||
value = edbob.local_time(value, from_=from_, to=to)
|
||||
value = localize(value, from_=from_, to=to)
|
||||
return literal('<span title="%s">%s</span>' % (
|
||||
value.strftime('%Y-%m-%d %H:%M:%S %Z%z'),
|
||||
pretty.date(value)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue