82
83
// load timezone
84
>
tz, err := b.loadTimezone(spec)
spec.go
85
>
if err != nil {
86
return nil, err
87
}
88
89
// compile StructuredCalendarSpecs
90
>
ccs := make([]*compiledCalendar, len(spec.StructuredCalendar))
spec.go
91
>
for i, structured := range spec.StructuredCalendar {
92
ccs[i] = newCompiledCalendar(structured, tz)
93
}
94
95
// compile excludes
96
>
excludes := make([]*compiledCalendar, len(spec.ExcludeStructuredCalendar))
spec.go
97
>
for i, excal := range spec.ExcludeStructuredCalendar {
98
excludes[i] = newCompiledCalendar(excal, tz)
99
}
100
101
>
cspec := &CompiledSpec{
spec.go
102
>
spec: spec,
103
>
tz: tz,
104
>
calendar: ccs,
105
>
excludes: excludes,
106
>
warnIterations: b.warnIterations,
107
>
maxIterations: b.maxIterations,
108
>
}
109
>
110
>
return cspec, nil
111
}
112