statusscreen/src/statusscreen/Clock.go

20 lines
395 B
Go

package statusscreen
import (
"github.com/common-nighthawk/go-figure"
"time"
)
// Clock is my Clock struct
type Clock struct {
Config *Config
}
// GetOutput returns a rendered result of this module
func (clock *Clock) GetOutput() []string {
currentTime := time.Now().Format(clock.Config.Clock.TimeFormat)
myFigure := figure.NewFigure(currentTime, "", true)
return myFigure.Slicify()
}