aboutsummaryrefslogtreecommitdiffstats
path: root/lib/templates
diff options
context:
space:
mode:
authorNojus Gudinavičius <nojus.gudinavicius@gmail.com>2023-01-11 14:27:26 +0200
committerRobin Jarry <robin@jarry.cc>2023-01-11 14:16:08 +0100
commit276c30f84d748ca639acbf5f85a37eca2425c2b3 (patch)
tree30b7d55d1545b65a61ef0e9b6828172020f0036d /lib/templates
parentd73f50f272de210fe4957ff107e1ff88887f1c20 (diff)
downloadaerc-276c30f84d748ca639acbf5f85a37eca2425c2b3.tar.gz
templates: correctly return week format when necessary
This fixes a bug when thisDayTimeFmt was returned for both this day and this week. Fixes: d758441fe0c4 ("templates: add more fields and functions") Signed-off-by: Nojus Gudinavičius <nojus.gudinavicius@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'lib/templates')
-rw-r--r--lib/templates/data.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/templates/data.go b/lib/templates/data.go
index cb69d8fe..e34dc2f3 100644
--- a/lib/templates/data.go
+++ b/lib/templates/data.go
@@ -186,7 +186,7 @@ func (d *TemplateData) DateAutoFormat(date time.Time) string {
case day == thisDay && d.thisDayTimeFmt != "":
fmt = d.thisDayTimeFmt
case day > thisDay-7 && d.thisWeekTimeFmt != "":
- fmt = d.thisDayTimeFmt
+ fmt = d.thisWeekTimeFmt
case d.thisYearTimeFmt != "":
fmt = d.thisYearTimeFmt
}