Versions in this module Expand all Collapse all v1 v1.1.0 Sep 9, 2026 v1.0.0 Aug 26, 2026 Changes in this version + const MaxCompositionDepth + const MaxHumanSummaryBytes + const MaxJSONBytes + func IsCode(err error, code Code) bool + type Availability struct + Explanation Explanation + Open bool + type Clock = clock.Clock + type Code string + const CodeAdjacent + const CodeAmbiguousException + const CodeAmbiguousLocalTime + const CodeDayBoundaryOverflow + const CodeDuplicateRevision + const CodeInvalidClock + const CodeInvalidDate + const CodeInvalidEncoding + const CodeInvalidHorizon + const CodeInvalidInterval + const CodeInvalidRange + const CodeInvalidState + const CodeInvalidTime + const CodeInvalidTimezone + const CodeInvalidWeekday + const CodeLimitExceeded + const CodeNonexistentLocalTime + const CodeOutsideEffectiveRange + const CodeOverlap + const CodeSearchExhausted + const CodeTimezoneMismatch + const CodeUnsupportedVersion + type Config struct + ConflictPolicy ConflictPolicy + EffectiveEnd *Date + EffectiveStart *Date + ExceptionSets []ExceptionSet + Exceptions []Exception + Metadata Metadata + OutsideEffective OutsideEffectivePolicy + Timezone string + Weekly map[time.Weekday]DayRule + type ConflictPolicy uint8 + const RejectAmbiguous + const ResolveCanonical + type DailyRange struct + End LocalTime + EndAtDayBoundary bool + Start LocalTime + type Date = calendar.Date + func MustDate(year int, month time.Month, day int) Date + func NewDate(year int, month time.Month, day int) (Date, error) + type DayResult struct + Ranges []Range + State DayState + type DayRule struct + func Closed() DayRule + func Inherited() DayRule + func OpenAllDay() DayRule + func OpenRanges(input []Range, policy OverlapPolicy) (DayRule, error) + func (rule DayRule) Ranges() []Range + func (rule DayRule) State() DayState + type DayState uint8 + const DayClosed + const DayInherited + const DayOpenAllDay + const DayOpenRanges + type ElapsedClock = clock.ElapsedClock + type Error struct + Code Code + Op string + func (e *Error) Error() string + type Exception struct + func NewException(config ExceptionConfig) (Exception, error) + func (e Exception) Date() Date + func (e Exception) Operation() ExceptionOperation + func (e Exception) Priority() int + func (e Exception) Revision() string + func (e Exception) Rule() DayRule + func (e Exception) Set() string + func (e Exception) Source() string + type ExceptionConfig struct + Date Date + Operation ExceptionOperation + Priority int + Revision string + Rule DayRule + Source string + type ExceptionOperation uint8 + const ExceptionAdd + const ExceptionClose + const ExceptionReplace + const ExceptionSubtract + type ExceptionRangeConfig struct + End Date + MaximumDates int + Name string + Operation ExceptionOperation + Priority int + Revision string + Rule DayRule + Source string + Start Date + type ExceptionSet struct + func ExpandExceptionRange(config ExceptionRangeConfig) (ExceptionSet, error) + func NewExceptionSet(name string, input []Exception) (ExceptionSet, error) + func (set ExceptionSet) Exceptions() []Exception + func (set ExceptionSet) Name() string + type Explanation struct + Revision string + Rule RuleKind + Source string + Timezone string + type InstantRange struct + End time.Time + Start time.Time + type LocalKind uint8 + const LocalExact + const LocalFold + const LocalGap + type LocalResolutionPolicy uint8 + const PreferEarlier + const PreferLater + const RejectDST + const ShiftForward + type LocalTime struct + func NewLocalTime(hour, minute, second, nanosecond int) (LocalTime, error) + func (t LocalTime) Hour() int + func (t LocalTime) Minute() int + func (t LocalTime) Nanosecond() int + func (t LocalTime) Second() int + type Metadata struct + Label string + Revision string + Source string + type Observation struct + Duration time.Duration + Operation Operation + Outcome Outcome + RangeCount int + SearchSteps int + type Observer func(Observation) + type Operation uint8 + const OperationIsOpen + const OperationNextTransition + type Outcome uint8 + const OutcomeClosed + const OutcomeError + const OutcomeFound + const OutcomeOpen + type OutsideEffectivePolicy uint8 + const OutsideClosed + const OutsideError + type OverlapPolicy uint8 + const MergeAdjacent + const MergeOverlap + const RejectOverlap + const RejectOverlapAndAdjacent + type Range struct + func NewRange(start, end LocalTime) (Range, error) + func (r Range) End() LocalTime + func (r Range) Overnight() bool + func (r Range) Start() LocalTime + type ResolvedLocal struct + Instant time.Time + Kind LocalKind + type RuleKind uint8 + const RuleComposition + const RuleException + const RuleNone + const RuleOutsideEffective + const RuleWeekly + const RuleWeeklySpill + type Schedule struct + func NewSchedule(config Config) (Schedule, error) + func ParseJSON(data []byte) (Schedule, error) + func (s *Schedule) Scan(source any) error + func (s *Schedule) UnmarshalJSON(data []byte) error + func (s *Schedule) UnmarshalText(data []byte) error + func (s Schedule) CanonicalJSON() ([]byte, error) + func (s Schedule) Compare(other Schedule) (int, error) + func (s Schedule) EffectiveInstantRanges(start, end time.Time) ([]InstantRange, error) + func (s Schedule) EffectiveRanges(date Date) ([]DailyRange, error) + func (s Schedule) Equal(other Schedule) bool + func (s Schedule) Hash() [sha256.Size]byte + func (s Schedule) HumanSummary() (string, error) + func (s Schedule) Intersection(other Schedule) (Schedule, error) + func (s Schedule) IsOpen(instant time.Time) (Availability, error) + func (s Schedule) IsOpenLocal(date Date, localTime LocalTime, policy LocalResolutionPolicy) (Availability, error) + func (s Schedule) IsOpenNow(clock Clock) (Availability, error) + func (s Schedule) MarshalJSON() ([]byte, error) + func (s Schedule) MarshalText() ([]byte, error) + func (s Schedule) Metadata() Metadata + func (s Schedule) NextClosing(instant time.Time, horizon time.Duration) (Transition, error) + func (s Schedule) NextOpening(instant time.Time, horizon time.Duration) (Transition, error) + func (s Schedule) NextTransition(instant time.Time, horizon time.Duration) (Transition, error) + func (s Schedule) ObserveIsOpen(instant time.Time, elapsedClock ElapsedClock, observer Observer) (Availability, error) + func (s Schedule) ObserveNextTransition(instant time.Time, horizon time.Duration, elapsedClock ElapsedClock, ...) (Transition, error) + func (s Schedule) OpenDuration(start, end time.Time) (time.Duration, error) + func (s Schedule) Overlay(other Schedule) (Schedule, error) + func (s Schedule) PreviousTransition(instant time.Time, horizon time.Duration) (Transition, error) + func (s Schedule) Ranges(date Date) (DayResult, error) + func (s Schedule) ResolveLocal(date Date, localTime LocalTime, policy LocalResolutionPolicy) (ResolvedLocal, error) + func (s Schedule) Revision() string + func (s Schedule) SemanticallyEqual(other Schedule) bool + func (s Schedule) String() string + func (s Schedule) Subtract(other Schedule) (Schedule, error) + func (s Schedule) Timezone() string + func (s Schedule) Union(other Schedule) (Schedule, error) + func (s Schedule) Value() (driver.Value, error) + type Transition struct + Explanation Explanation + Instant time.Time + Kind TransitionKind + type TransitionKind uint8 + const TransitionClose + const TransitionOpen