headscale/cmd/headscale/cli/pterm_style.go
Kristoffer Dalby ead8b68a03 Fix lint
2022-02-12 19:42:55 +00:00

19 lines
284 B
Go

package cli
import (
"time"
"github.com/pterm/pterm"
)
func ColourTime(date time.Time) string {
dateStr := date.Format("2006-01-02 15:04:05")
if date.After(time.Now()) {
dateStr = pterm.LightGreen(dateStr)
} else {
dateStr = pterm.LightRed(dateStr)
}
return dateStr
}