dates

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToCoded

func ConvertToCoded(dates []time.Time) []string

ConvertToCoded takes a list of time.Time and converts to a list of strings in the format yyyy.mm

func ConvertToMonthYear

func ConvertToMonthYear(d time.Time) string

ConvertToMonthYear takes a time.Time object and converts to MM yyyy

func ConvertToReadable

func ConvertToReadable(dates []string) ([]time.Time, error)

ConvertToReadable takes a list of dates in the format Jan-06 and converts to a list of time.Time

Types

type TimeSlice

type TimeSlice []time.Time

TimeSlice allows sorting of a list of time.Time

func Sort

func Sort(dates []time.Time) TimeSlice

Sort orders a list of times

func (TimeSlice) Len

func (p TimeSlice) Len() int

func (TimeSlice) Less

func (p TimeSlice) Less(i, j int) bool

func (TimeSlice) Swap

func (p TimeSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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