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:
committed by
Chris Cummer
parent
dd170c0ab3
commit
1bf6efdaf8
10
wtf/utils.go
10
wtf/utils.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user