fix: respect client timezone for requests (#119)

* maybe fixed for total listen activity

* maybe actually fixed now

* fix unset location panics
This commit is contained in:
Gabe Farrell 2026-01-10 01:45:31 -05:00 committed by GitHub
parent 2925425750
commit f48dd6c039
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 368 additions and 343 deletions

View file

@ -127,6 +127,12 @@ func DateRange(week, month, year int) (time.Time, time.Time, error) {
return start, end, nil
}
// Returns a time.Time that represents the first moment of the day of t.
func BeginningOfDay(t time.Time) time.Time {
year, month, day := t.Date()
return time.Date(year, month, day, 0, 0, 0, 0, t.Location())
}
// CopyFile copies a file from src to dst. If src and dst files exist, and are
// the same, then return success. Otherise, attempt to create a hard link
// between the two files. If that fail, copy the file contents from src to dst.