From bd54ff49b75d712a32131352a316450c07c75aaf Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Sun, 12 Apr 2020 14:33:51 -0400 Subject: Improve date module Add Weekday, 3 letter month, date and year --- dateModule.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dateModule.go') diff --git a/dateModule.go b/dateModule.go index baabe5a..1fe60fa 100644 --- a/dateModule.go +++ b/dateModule.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + "strconv" "time" ) @@ -10,7 +12,6 @@ type DateModule struct { // getDate formats a string for the status bar func (_ DateModule) GetInfo() (string, error) { now := time.Now() - // return string([]rune(now.Weekday().String()[0:3])) - // return now.Format(time.Stamp) - return string([]rune(now.Month().String())) + " " + now.Format(time.Kitchen), nil + // 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