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


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

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


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

Add error handling for invalid date times in macro
Add error handling for invalid date times in macro
