holiday

package
v0.0.0-...-69d094b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddYearYAML

func AddYearYAML(year int, data []byte) error

AddYearYAML 添加 (如果已存在则覆盖) 某年的一个配置, 配置只支持 MM-DD 格式, yaml 格式

func Day

func Day(year, month, day int) time.Time

Day 构建某一天的 0:00:00 时刻

func NextHoliday

func NextHoliday() (int, string)

NextHoliday 返回下一个假日在几天后, 以及假日的名称。如果当天是假日, 则返回 0

func NextHolidayForDate

func NextHolidayForDate(date time.Time) (int, string)

NextHolidayForDate 返回指定日期的下一个假日在几天后, 以及假日的名称。如果当天是假日, 则返回 0

func NextWorkday

func NextWorkday() int

NextWorkday 返回下一个工作日在几天后, 如果今天是假日, 则返回 1

func NextWorkdayForDate

func NextWorkdayForDate(date time.Time) int

NextWorkdayForDate 返回指定日期的下一个工作日在几天后, 如果今天是假日, 则返回 1

func Override

func Override(day time.Time, holidayName string)

Override 覆盖某一天的属性, holidayName 如果传空或 "工作日" 则表示设置为工作日, 否则设置为对应名称的休息日

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL