Documentation
¶
Index ¶
- type Date
- func (d Date) AddDays(day int) Date
- func (d Date) AddMonths(month int) Date
- func (d Date) AddYears(year int) Date
- func (d Date) CurrentToWeekday(weekday time.Weekday) Date
- func (d Date) ForTo(endDate Date, interval uint, callback func(curr Date, percent int))
- func (d Date) MarshalJSON() ([]byte, error)
- func (d Date) ToString() string
- func (d Date) ToTime() time.Time
- func (d *Date) UnmarshalJSON(data []byte) error
- func (d Date) Week() time.Weekday
- func (d Date) YearWeek() int
- type DateTime
- func (d DateTime) AddDays(day int) Date
- func (d DateTime) AddHours(hour int) Date
- func (d DateTime) AddMinutes(minute int) Date
- func (d DateTime) AddMonths(month int) Date
- func (d DateTime) AddSeconds(second int) Date
- func (d DateTime) AddYears(year int) Date
- func (d DateTime) CurrentToWeekday(weekday time.Weekday) DateTime
- func (d DateTime) ForTo(endDate DateTime, interval uint, callback func(curr DateTime, percent int))
- func (d DateTime) MarshalJSON() ([]byte, error)
- func (d DateTime) ToString() string
- func (d DateTime) ToTime() time.Time
- func (d *DateTime) UnmarshalJSON(data []byte) error
- func (d DateTime) Week() time.Weekday
- func (d DateTime) YearWeek() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date uint32
Date 基于整形存储的日期类型,例如:20240101
func (Date) CurrentToWeekday ¶
CurrentToWeekday
@Description: 获取当前日期所在本周指定周几的日期 @param weekday 需要返回周几 @return date 周几日期
func (Date) ForTo ¶
ForTo
@Description: 自动循环遍历日期,并按日返回每天日期 @param endDate 结束日期 @param interval 日期间隔 @param callback 回调 @return int YYYY年+WW周,如 202451
type DateTime ¶
type DateTime uint64
DateTime 基于整形存储的日期时间类型,例如:20240101105312
func (DateTime) CurrentToWeekday ¶
CurrentToWeekday
@Description: 获取当前日期所在本周指定周几的日期 @param weekday 需要返回周几 @return date 周几日期
func (DateTime) ForTo ¶
ForTo
@Description: 自动循环遍历日期,并按日返回每天日期 @param endDate 结束日期 @param interval 日期间隔 @param callback 回调 @return int YYYY年+WW周,如 202451
Click to show internal directories.
Click to hide internal directories.