u 3 years ago
parent
commit
7ad2f23f21
  1. 12
      core.go

12
core.go

@ -5,6 +5,7 @@ import (
"log"
"sort"
"strings"
"sync"
"time"
"github.com/google/uuid"
@ -99,12 +100,21 @@ func isInWeekOfDay(t time.Time, ta TimeArrow) bool {
return false
}
var timeCompletionCache sync.Map
func timeCompletion(a string) string {
rets, ok := timeCompletionCache.Load(a)
if ok {
return rets.(string)
}
sc := strings.Split(a, ":")
for len(sc) < 3 {
sc = append(sc, "00")
}
return strings.Join(sc, ":")
ret := strings.Join(sc, ":")
timeCompletionCache.Store(a, ret)
return ret
}
func isInDayOfMonth(t time.Time, ta TimeArrow) bool {

Loading…
Cancel
Save