From 3b25b5bc0254c7462555c9911c67266627428795 Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Fri, 2 Oct 2020 23:10:52 -0400 Subject: Create modules package --- modules/dateModule.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 modules/dateModule.go (limited to 'modules/dateModule.go') diff --git a/modules/dateModule.go b/modules/dateModule.go new file mode 100644 index 0000000..9dec1dd --- /dev/null +++ b/modules/dateModule.go @@ -0,0 +1,17 @@ +package modules + +import ( + "fmt" + "strconv" + "time" +) + +type DateModule struct { +} + +// getDate formats a string for the status bar +func (_ DateModule) GetInfo() (string, error) { + now := time.Now() + // return now.Weekday().String() + " " + now.Month().String()[0:3] + " " + now.Year(), nil + return fmt.Sprintf("%s %s %s %s", now.Weekday(), now.Month().String()[0:3], strconv.Itoa(now.Day()), strconv.Itoa(now.Year())), nil +} -- cgit v1.2.3