aboutsummaryrefslogtreecommitdiff
path: root/internal/template/functions.go
diff options
context:
space:
mode:
authorGravatar jvoisin <julien.voisin@dustri.org> 2024-02-27 17:19:38 +0100
committerGravatar Frédéric Guillot <f@miniflux.net> 2024-02-28 19:24:41 -0800
commit5a7d6f89975959e0a1a63f1ac68d5bb41f01ab2c (patch)
tree992245da4fdf2ef81448dc6fb4c126d98a478304 /internal/template/functions.go
parentb4ed17fbac15d71fa379ca463d63c7e36d833fd2 (diff)
downloadv2-5a7d6f89975959e0a1a63f1ac68d5bb41f01ab2c.tar.gz
v2-5a7d6f89975959e0a1a63f1ac68d5bb41f01ab2c.tar.zst
v2-5a7d6f89975959e0a1a63f1ac68d5bb41f01ab2c.zip
Make use of printer.Print when possible
Diffstat (limited to 'internal/template/functions.go')
-rw-r--r--internal/template/functions.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/template/functions.go b/internal/template/functions.go
index 2db98420..08720dff 100644
--- a/internal/template/functions.go
+++ b/internal/template/functions.go
@@ -180,13 +180,13 @@ func durationImpl(t time.Time, now time.Time) string {
func elapsedTime(printer *locale.Printer, tz string, t time.Time) string {
if t.IsZero() {
- return printer.Printf("time_elapsed.not_yet")
+ return printer.Print("time_elapsed.not_yet")
}
now := timezone.Now(tz)
t = timezone.Convert(tz, t)
if now.Before(t) {
- return printer.Printf("time_elapsed.not_yet")
+ return printer.Print("time_elapsed.not_yet")
}
diff := now.Sub(t)
@@ -196,7 +196,7 @@ func elapsedTime(printer *locale.Printer, tz string, t time.Time) string {
d := int(s / 86400)
switch {
case s < 60:
- return printer.Printf("time_elapsed.now")
+ return printer.Print("time_elapsed.now")
case s < 3600:
minutes := int(diff.Minutes())
return printer.Plural("time_elapsed.minutes", minutes, minutes)
@@ -204,7 +204,7 @@ func elapsedTime(printer *locale.Printer, tz string, t time.Time) string {
hours := int(diff.Hours())
return printer.Plural("time_elapsed.hours", hours, hours)
case d == 1:
- return printer.Printf("time_elapsed.yesterday")
+ return printer.Print("time_elapsed.yesterday")
case d < 21:
return printer.Plural("time_elapsed.days", d, d)
case d < 31: