datetime

package module
v0.10.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

README

datetime

extending datetime

GoDoc GitHub stars Go Report Card codecov

Vesions

Stable Version GitHub Release GitHub Release

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Calculate added in v0.10.0

func Calculate(year int) time.Time

func DaysInMonth

func DaysInMonth(year int, month int) int

func DaysInMonthByDate

func DaysInMonthByDate(t time.Time) int

func DaysInMonthList added in v0.10.0

func DaysInMonthList(year int, month int) []int

func GetDate

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

func GetEaster

func GetEaster(year int) time.Time

func GetGoodFriday

func GetGoodFriday(year int) time.Time

func GetMonday

func GetMonday(year int) time.Time

Types

type Date

type Date struct {
	Year     int
	Month    int `validate:"min=1,max=12"`
	Day      int `validate:"min=1,max=31"`
	DateTime time.Time
}

func NewDate

func NewDate(year int, month int, day int) (*Date, error)

func (Date) Compare

func (d Date) Compare(u Date) int

Compare compares the date instant d with u. If d is before u, it returns -1; if d is after u, it returns +1; if they're the same, it returns 0.

func (Date) Equal

func (d Date) Equal(u Date) bool

func (*Date) IsWeekend

func (d *Date) IsWeekend() bool

func (*Date) Time

func (d *Date) Time() time.Time

Jump to

Keyboard shortcuts

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