Documentation
¶
Overview ¶
Package calendar defines the Shanghai civil-date rules shared by Life@USTC clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShanghaiDate ¶
ShanghaiDate converts an instant to its Shanghai calendar date.
func TeachingWeekNumber ¶ added in v0.2.0
TeachingWeekNumber returns the week containing selectedDate, counting the week containing semesterStart as one. Earlier weeks have zero/negative numbers; the caller decides whether that week belongs to the semester.
Types ¶
type DateRange ¶
DateRange contains inclusive Shanghai calendar dates.
func Bounds ¶
Bounds returns the complete day, week or month containing anchor. firstWeekday is explicit because public and personal calendars differ.
func RequestWindows ¶
RequestWindows divides an inclusive range into adjacent windows of at most 366 days.