Documentation ¶
Index ¶
- Constants
- func SameDay(a time.Time, b time.Time) bool
- func SameMonth(a time.Time, b time.Time) bool
- func SameQuarter(a time.Time, b time.Time) bool
- func SameWeek(a time.Time, b time.Time) bool
- func SameYear(a time.Time, b time.Time) bool
- type Between
- type HM
- type HMBetween
- type OHByWeekSetting
- type OHItem
- type OHNoLimitSetting
- type OHSetting
- type OpeningHours
Constants ¶
View Source
const ( OpeningHoursNoLimit = "no_limit" //不限 OpeningHoursByWeek = "week" //按周设置 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Between ¶
type OHByWeekSetting ¶
type OHByWeekSetting struct { Exclude []time.Weekday `bson:"exclude" json:"exclude"` //排除日期 DefaultSetting []HMBetween `bson:"default_setting" json:"default_setting"` //默认设置 SpecialSetting map[int][]HMBetween `bson:"special_setting" json:"special_setting"` //特殊指定 }
func (OHByWeekSetting) GetOpening ¶
func (ohw OHByWeekSetting) GetOpening(dt time.Time) (bool, OHItem)
func (OHByWeekSetting) Next ¶
func (ohw OHByWeekSetting) Next(benchmark time.Time, size int) []OHItem
func (OHByWeekSetting) Verify ¶
func (ohw OHByWeekSetting) Verify() *errors.Error
type OHNoLimitSetting ¶
type OHNoLimitSetting struct{}
func (OHNoLimitSetting) GetOpening ¶
func (ohl OHNoLimitSetting) GetOpening(dt time.Time) (bool, OHItem)
func (OHNoLimitSetting) Next ¶
func (ohl OHNoLimitSetting) Next(benchmark time.Time, size int) []OHItem
func (OHNoLimitSetting) Verify ¶
func (ohl OHNoLimitSetting) Verify() *errors.Error
type OpeningHours ¶
type OpeningHours struct { Mode string `bson:"mode" json:"mode"` //设置模式 WeekSetting *OHByWeekSetting `bson:"week_setting" json:"week_setting"` //基于周设置 }
func (OpeningHours) GetOpening ¶
func (oh OpeningHours) GetOpening(dt time.Time) (bool, OHItem)
func (OpeningHours) Verify ¶
func (oh OpeningHours) Verify() *errors.Error
Click to show internal directories.
Click to hide internal directories.