Closed MetRonnie closed 11 months ago
Not such a crucial bug as you can do PT1H1S
instead, hence tagged against 8.x
Interestingly now had a userbitten by this because the offset is created by a fairly complex macro.
{% macro format_final(run_periods, fmt='PT1S') -%}
{%- set ENDYR = '+P%dY'%(run_periods[0]) if run_periods[0] > 0 else '' -%}
{%- set ENDMO = '+P%dM'%(run_periods[1]) if run_periods[1] > 0 else '' -%}
{%- set ENDDA = '+P%dD'%(run_periods[2]) if run_periods[2] > 0 else '' -%}
{%- set ENDHR = '+PT%dH'%(run_periods[3]) if run_periods[3] > 0 else '' -%}
{%- set ENDMI = '+PT%dM'%(run_periods[4]) if run_periods[4] > 0 else '' -%}
{%- set ENDSE = '+PT%dS'%(run_periods[5]) if run_periods[5] > 0 else '' -%}
{{ENDYR}}{{ENDMO}}{{ENDDA}}{{ENDHR}}{{ENDMI}}{{ENDSE}}-{{fmt}}
{%- endmacro %}
Interim suggested fix was:
- {{ENDYR}}{{ENDMO}}{{ENDDA}}{{ENDHR}}{{ENDMI}}{{ENDSE}}-{{fmt}}
+ {%- set END = ENDYR + ENDMO + ENDDA + ENDHR + ENDMI + ENDSE -%}
+ PT{{END[1:] | duration_as('s') | int - fmt | duration_as('s') | int }}S
Describe the bug
It is treating everything between the first
PT
and the finalS
as the number of seconds.Release version(s) and/or repository branch(es) affected? 8.0.0
Pull requests welcome! This is an Open Source project - please consider contributing a bug fix yourself (please read
CONTRIBUTING.md
before starting any work though).