mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 20:11:50 -07:00
fix unset location panics
This commit is contained in:
parent
738ac871e6
commit
b3128c164e
3 changed files with 20 additions and 38 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue