1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Hacky timezone display in Status

This commit is contained in:
Chris Cummer
2018-04-12 12:00:11 -07:00
committed by Chris Cummer
parent dd170c0ab3
commit 1bf6efdaf8
3 changed files with 54 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import (
// DateFormat defines the format we expect to receive dates from BambooHR in
const DateFormat = "2006-01-02"
const TimeFormat = "15:04 MST"
func CenterText(str string, width int) string {
return fmt.Sprintf("%[1]*s", -width, fmt.Sprintf("%[1]*s", (width+len(str))/2, str))
@@ -89,6 +90,15 @@ func ToInts(slice []interface{}) []int {
return results
}
func ToStrs(slice []interface{}) []string {
results := []string{}
for _, val := range slice {
results = append(results, val.(string))
}
return results
}
func UnixTime(unix int64) time.Time {
return time.Unix(unix, 0)
}