summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackson Taylor <jtaylormuffins@gmail.com>2020-04-12 14:33:51 -0400
committerJackson Taylor <jtaylormuffins@gmail.com>2020-04-12 14:33:51 -0400
commitbd54ff49b75d712a32131352a316450c07c75aaf (patch)
tree0b96436c2d638ac232db42f407c010a90dbf2548
parentbd8fd546b32193cf50f276079bc9f5dbbb3c7fbf (diff)
Improve date module
Add Weekday, 3 letter month, date and year
-rw-r--r--dateModule.go7
1 files changed, 4 insertions, 3 deletions
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
}