ldate

package
v0.0.0-...-8199c21 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Jan = January
	Feb = February
	Mar = March
	Apr = April
	Jun = June
	Jul = July
	Aug = August
	Sep = September
	Oct = October
	Nov = November
	Dec = December
)

Variables

This section is empty.

Functions

func Less

func Less(a, b Date) bool

func MonthYear

func MonthYear[M, Y constraints.Integer](m M, y Y) (Month, Year)

Types

type Date

type Date struct {
	Year  Year
	Month Month
	Day   int
}

func FromTime

func FromTime(t time.Time) Date

func New

func New(y, m, d int) Date

func Now

func Now() Date

func TimeToDate

func TimeToDate(t time.Time) Date

func (Date) Before

func (d Date) Before(d2 Date) bool

func (Date) Next

func (d Date) Next() Date

func (Date) Resolve

func (d Date) Resolve() Date

func (Date) Seek

func (d Date) Seek(f filter.Filter[Date], max int) (Date, bool)

func (Date) String

func (d Date) String() string

func (Date) Valid

func (d Date) Valid() bool

func (Date) Weekday

func (d Date) Weekday() time.Weekday

type Month

type Month byte
const (
	January Month = 1 + iota
	February
	March
	April
	May
	June
	July
	August
	September
	October
	November
	December
)

func (Month) Days

func (m Month) Days(y Year) int

func (Month) Name

func (m Month) Name(short bool) string

func (Month) String

func (m Month) String() string

func (Month) Valid

func (m Month) Valid() bool

type Unit

type Unit int64

func (Unit) Date

func (u Unit) Date() int

func (Unit) Leapdays

func (u Unit) Leapdays() int64

Leapdays between u and and Unit(0). Note that if u is negative, the number of leap days will be negative.

func (Unit) Month

func (u Unit) Month() Month

func (Unit) Year

func (u Unit) Year() Year

type Year

type Year int

func (Year) IsLeapYear

func (y Year) IsLeapYear() bool

func (Year) Leapdays

func (y Year) Leapdays() int64

func (Year) String

func (y Year) String() string

Jump to

Keyboard shortcuts

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