datetime

package module
v0.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

README

datetime

extending datetime

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaysInMonth

func DaysInMonth(year int, month int) int

func DaysInMonthByDate

func DaysInMonthByDate(t time.Time) 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

func ListDaysInMonth

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

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

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