CoreNextTime

package
v5.1.42 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTimeByTimeN2

func CheckTimeByTimeN2(prevAt carbon.Carbon, checkAt carbon.Carbon, timeType int, timeN []int64) bool

CheckTimeByTimeN2 规范的时间周期长度检查 检查当前时间是否符合条件 prevTime 上次检查时间,一般存在配置内,方便计算下一次执行时间差异 addTime 要计算的时间,默认为当前时间 timeType 时间类型 0 每天重复 day / 1 每周重复 week / 2 每月重复 month / 3 临时1次 once / 4 每隔N天重复 day_n / 5 每隔N周重复 week_n / 6 每隔N月重复 month_n / 7 每个星期N重复 week_n / 8 每隔N小时重复 hour_n timeN 扩展N

重复时间内,数组的第一个值作为相隔N;
重复周内,数组代表指定的星期1-7

func GetTimeByTimeN2

func GetTimeByTimeN2(addTime carbon.Carbon, timeType int, timeN []int64) (carbon.Carbon, bool)

GetTimeByTimeN2 规范的时间周期长度 制定高级别的时间周期设计,计算出下一次检查创建的时间

func GetTimeByTimeN2Now

func GetTimeByTimeN2Now(addTime carbon.Carbon, timeType int, timeN []int64) (carbon.Carbon, bool)

GetTimeByTimeN2Now 递归处理直到时间抵达今日

func MakeBeforeAt

func MakeBeforeAt(timeType int, timeN []int64, skipHoliday bool, nextAt carbon.Carbon) (newTime carbon.Carbon, needDeleteConfig bool, b bool)

MakeBeforeAt 生成上一轮日期

func MakeNextAt

func MakeNextAt(timeType int, timeN []int64, skipHoliday bool, nextAt carbon.Carbon) (newTime carbon.Carbon, needDeleteConfig bool, b bool)

MakeNextAt 生成下一个日期

Types

This section is empty.

Jump to

Keyboard shortcuts

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