Skip to content

Commit ade7e2a

Browse files
committed
Rename to formatCurrentDate
1 parent 815a4f4 commit ade7e2a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/gui/services/custom_commands/handler_creator.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,19 @@ type CustomCommandObjects struct {
237237
*SessionState
238238
PromptResponses []string
239239
Form map[string]string
240-
Now time.Time
241240
}
242241

243242
func (self *HandlerCreator) getResolveTemplateFn(form map[string]string, promptResponses []string, sessionState *SessionState) func(string) (string, error) {
244243
objects := CustomCommandObjects{
245244
SessionState: sessionState,
246245
PromptResponses: promptResponses,
247246
Form: form,
248-
Now: time.Now(),
249247
}
250248

251249
funcs := template.FuncMap{
252250
"quote": self.c.OS().Quote,
253-
"formatDate": func(t time.Time, layout string) string {
254-
return t.Format(layout)
251+
"formatCurrentDate": func(layout string) string {
252+
return time.Now().Format(layout)
255253
},
256254
}
257255

0 commit comments

Comments
 (0)