fix unset location panics

This commit is contained in:
Gabe Farrell 2026-01-10 01:11:02 -05:00
parent 738ac871e6
commit b3128c164e
3 changed files with 20 additions and 38 deletions

View file

@ -19,6 +19,9 @@ type Timeframe struct {
func TimeframeToTimeRange(tf Timeframe) (t1, t2 time.Time) {
now := time.Now()
loc := tf.Timezone
if loc == nil {
loc, _ = time.LoadLocation("UTC")
}
// ---------------------------------------------------------------------
// 1. Explicit From / To (time.Time) — highest precedence