94
95
// Returns true if the given time matches this calendar spec.
96
>
func (cc *compiledCalendar) matches(ts time.Time) bool {
calendar.go
97
>
// set time zone
98
>
ts = ts.In(cc.tz)
99
>
100
>
// get ymdhms from ts
101
>
y, mo, d := ts.Date()
102
>
h, m, s := ts.Clock()
103
>
104
>
return cc.year(y) &&
105
>
cc.month(int(mo)) &&
106
>
cc.dayOfMonth(d) &&
107
>
cc.dayOfWeek(int(ts.Weekday())) &&
108
>
cc.hour(h) &&
109
>
cc.minute(m) &&
110
>
cc.second(s)
111
>
}
112
113
// Returns the earliest time that matches this calendar spec that is after the given time.