From 153d630504a357b3c782623d0b58f11198e406ef Mon Sep 17 00:00:00 2001 From: Tamas Koos Date: Fri, 2 Aug 2024 09:43:30 +0200 Subject: [PATCH] speak_the_days fix for negative indexes --- easy_time.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy_time.jinja b/easy_time.jinja index 9014bf9..ae5475a 100644 --- a/easy_time.jinja +++ b/easy_time.jinja @@ -1561,7 +1561,7 @@ {%- set ns = namespace(days=[]) %} {%- for i in range(-7, 14) %} {%- set prefix = translate('delta', 'last', language=language) ~ ' ' if i < -1 else translate('delta', 'next', language=language) ~ ' ' if i > 6 else '' %} - {%- set ns.days = ns.days + [ (i | string, prefix ~ _days.get(i, weekday(midnight.weekday() + i + 1, language))) ] %} + {%- set ns.days = ns.days + [ (i | string, prefix ~ _days.get(i, weekday(midnight.weekday() + (i % 7) + 1, language))) ] %} {%- endfor %} {%- set collection = dict.from_keys(ns.days) %} {%- set days = count_the_days(input, attr, utc) %}