christabor/flask_extras

View on GitHub
flask_extras/macros/dates.html

Summary

Maintainability
Test Coverage
{%- macro simpledatetime(timestr) %}
{% set t = timestr|str2dt %}
{% if t %}{{ t.strftime('%Y-%m-%d %H:%M:%S') }}{% else %}{{ t }}{% endif %}
{% endmacro -%}


{%- macro simpledate(timestr) %}
{% set t = timestr|str2dt %}
{% if t %}{{ t.strftime('%Y-%m-%d') }}{% else %}{{ t }}{% endif %}
{% endmacro -%}