github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/pkg/tslib/range.go (about) 1 package tslib 2 3 import ( 4 "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base" 5 "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types" 6 ) 7 8 func RangeToBounds(chain string, rng *base.FileRange) types.RangeDates { 9 firstTs, _ := FromBnToTs(chain, base.Value(rng.First)) 10 lastTs, _ := FromBnToTs(chain, base.Value(rng.Last)) 11 ret := types.RangeDates{ 12 FirstTs: firstTs, 13 FirstDate: base.FormattedDate(firstTs), 14 LastTs: lastTs, 15 LastDate: base.FormattedDate(lastTs), 16 } 17 return ret 18 }