Files
lo/docs/data/core-earliest.md
T
2025-10-06 17:15:49 +02:00

753 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Earliest earliest find.go#L363 core find
core#find#earliest
core#find#latest
core#find#earliestby
core#find#latestby
core#find#min
core#find#max
core#find#minby
core#find#maxby
core#find#minindex
core#find#maxindex
core#find#minindexby
core#find#maxindexby
180
func Earliest(times ...time.Time) time.Time

Searches the minimum time.Time in the provided arguments. Returns zero value when the input is empty.

t1 := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)
t2 := time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC)
min := lo.Earliest(t2, t1)
// 2023-01-01 00:00:00 +0000 UTC