From 5c305cd887ce05d102168e576e65971f2c168c73 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 6 Dec 2022 18:45:50 +0100 Subject: [PATCH] Fix: Allow locale time in templating Signed-off-by: Knut Ahlers --- mod_streamSchedule.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod_streamSchedule.go b/mod_streamSchedule.go index f6da1c9..3935ddb 100644 --- a/mod_streamSchedule.go +++ b/mod_streamSchedule.go @@ -212,8 +212,11 @@ func (m modStreamSchedule) assembleEmbed(data *twitchStreamSchedule) *discordgo. } func (m modStreamSchedule) executeContentTemplate(data *twitchStreamSchedule) (string, error) { + fns := sprig.FuncMap() + fns["localeStrftime"] = localeStrftime + tpl, err := template.New("streamschedule"). - Funcs(sprig.FuncMap()). + Funcs(fns). Parse(m.attrs.MustString("content", ptrStringEmpty)) if err != nil { return "", errors.Wrap(err, "parsing template")