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

Column and row definitions into the config file. No need to compile to change sizes

This commit is contained in:
Chris Cummer
2018-04-09 13:19:16 -07:00
committed by Chris Cummer
parent cc4b5714f0
commit 7072820967
4 changed files with 35 additions and 3 deletions

View File

@@ -44,6 +44,14 @@ func Exclude(strs []string, val string) bool {
return true
}
func IsToday(date time.Time) bool {
now := time.Now()
return (date.Year() == now.Year()) &&
(date.Month() == now.Month()) &&
(date.Day() == now.Day())
}
func NameFromEmail(email string) string {
parts := strings.Split(email, "@")
return strings.Title(strings.Replace(parts[0], ".", " ", -1))
@@ -69,6 +77,15 @@ func Today() string {
return localNow.Format("2006-01-02")
}
func ToInts(slice []interface{}) []int {
results := []int{}
for _, val := range slice {
results = append(results, val.(int))
}
return results
}
func UnixTime(unix int64) time.Time {
return time.Unix(unix, 0)
}