mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-15 10:25:55 -07:00
fix: get current time in tz for listen activity (#146)
* fix: get current time in tz for listen activity * fix: adjust test to prevent timezone errors
This commit is contained in:
parent
9dbdfe5e41
commit
92648167f0
3 changed files with 7 additions and 7 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