From 276c30f84d748ca639acbf5f85a37eca2425c2b3 Mon Sep 17 00:00:00 2001 From: Nojus Gudinavičius Date: Wed, 11 Jan 2023 14:27:26 +0200 Subject: templates: correctly return week format when necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Bence Ferdinandy --- lib/templates/data.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/templates/data.go') 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 } -- cgit