accept string in modified date
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3987 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
83490b51eb
commit
31051a94ed
1 changed files with 4 additions and 0 deletions
|
@ -24,7 +24,9 @@ $Id$
|
||||||
|
|
||||||
from cgi import parse_qs, parse_qsl
|
from cgi import parse_qs, parse_qsl
|
||||||
#import mimetypes # use more specific assignments from cybertools.text
|
#import mimetypes # use more specific assignments from cybertools.text
|
||||||
|
from datetime import datetime
|
||||||
import re
|
import re
|
||||||
|
from time import strptime
|
||||||
from urllib import urlencode
|
from urllib import urlencode
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.app.form.browser.interfaces import ITerms
|
from zope.app.form.browser.interfaces import ITerms
|
||||||
|
@ -222,6 +224,8 @@ class BaseView(GenericView, I18NView):
|
||||||
if not d:
|
if not d:
|
||||||
dc = IZopeDublinCore(self.context)
|
dc = IZopeDublinCore(self.context)
|
||||||
d = dc.modified or dc.created
|
d = dc.modified or dc.created
|
||||||
|
if isinstance(d, str):
|
||||||
|
d = datetime(*(strptime(d, '%Y-%m-%dT%H:%M')[:6]))
|
||||||
return d and d.strftime('%Y-%m-%d %H:%M') or ''
|
return d and d.strftime('%Y-%m-%d %H:%M') or ''
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
|
Loading…
Add table
Reference in a new issue