You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation for themes, you mention formatting datetime like this: {% if media.exif.datetime %} {{ media.exif.datetime.strftime('%A, %d. %B %Y') }} {% endif %}
However, media.exif.datetime does not appear to be a Python datetime object. When I attempt this in the colorbox index.html, I get the following error File "/media/cams/themes/colorbox/templates/index.html", line 44, in template data-date=", {{ media.exif.datetime.strftime('%c') }}" jinja2.exceptions.UndefinedError: 'unicode object' has no attribute 'strftime'
Am I missing something?
Thank you.
The text was updated successfully, but these errors were encountered:
The documentation is wrong (sorry!), datetime is indeed a formatted string (with strftime('%A, %d. %B %Y')), but there is also a dateobj key with the Python datetime object: https://github.com/saimn/sigal/blob/master/sigal/image.py#L303-L316
Can you check if it works for you ? (And if you want to fix it, you're welcome 😉 )
nelsonov
added a commit
to nelsonov/sigal
that referenced
this issue
Nov 26, 2017
As discussed in Issue saimn#271
In the documentation media.dateobj was mistakenly called
media.datetime while media.datetime itself is a string.
Added some more media date related values. To avoid breaking things,
dateobj and datetime remain unchanged. datetimelocal, datelocal and
timelocal were added. As their names imply, they contain values
appropriate for the system's LOCALE.
In the documentation for themes, you mention formatting datetime like this:
{% if media.exif.datetime %}
{{ media.exif.datetime.strftime('%A, %d. %B %Y') }}
{% endif %}
However, media.exif.datetime does not appear to be a Python datetime object. When I attempt this in the colorbox index.html, I get the following error
File "/media/cams/themes/colorbox/templates/index.html", line 44, in template
data-date=", {{ media.exif.datetime.strftime('%c') }}"
jinja2.exceptions.UndefinedError: 'unicode object' has no attribute 'strftime'
Am I missing something?
Thank you.
The text was updated successfully, but these errors were encountered: