timeutil

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDateFromString

func GetDateFromString(dateStr string) (*time.Time, error)

GetDateFromString converts the dateStr in format 2020-01-12 to time.Time

func ParseDatePayload

func ParseDatePayload(year, month, day int32) (int32, int32, int32, error)

ParseDatePayload parses the date provided and fails if it's greater than current time

func ParseDay

func ParseDay(day int32) (int32, error)

ParseDay parses the day and fails if it's incorrect

func ParseDayEndTime

func ParseDayEndTime(year, month, day int32) (time.Time, error)

ParseDayEndTime parses the provided year, month and day into latest time of the day

func ParseDayStartTime

func ParseDayStartTime(year, month, day int32) (*time.Time, error)

ParseDayStartTime parses the provided year, month and day into the earliest time of the day.

func ParseMonth

func ParseMonth(month int32) (int32, error)

ParseMonth parses the month and fails if it's incorrect

func ParseMonthPayload

func ParseMonthPayload(year, month int32) (int32, int32, error)

ParseMonthPayload parses month payload and fails if month is greater than current time

func ParseYear

func ParseYear(year int32) (int32, error)

ParseYear parses the year and fails it it's incorrect

func TimeGreaterThanCurrentDay

func TimeGreaterThanCurrentDay(year, month, day int32) error

TimeGreaterThanCurrentDay checks whether the provided time details is greater than current day

func TimeGreaterThanCurrentMonth

func TimeGreaterThanCurrentMonth(year, month int32) error

TimeGreaterThanCurrentMonth checks whether the month is greater than current month

Types

This section is empty.

Jump to

Keyboard shortcuts

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