mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-23 04:21:51 -07:00
fix: get current time in tz for listen activity
This commit is contained in:
parent
9dbdfe5e41
commit
03ebaa18c1
2 changed files with 5 additions and 5 deletions
|
|
@ -57,11 +57,11 @@ const (
|
|||
// and end will be 23:59:59 on Saturday at the end of the current week.
|
||||
// If opts.Year (or opts.Year + opts.Month) is provided, start and end will simply by the start and end times of that year/month.
|
||||
func ListenActivityOptsToTimes(opts ListenActivityOpts) (start, end time.Time) {
|
||||
now := time.Now()
|
||||
loc := opts.Timezone
|
||||
if loc == nil {
|
||||
loc, _ = time.LoadLocation("UTC")
|
||||
}
|
||||
now := time.Now().In(loc)
|
||||
|
||||
// If Year (and optionally Month) are specified, use calendar boundaries
|
||||
if opts.Year != 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue