groundwork for generating member export (unfinished)

This commit is contained in:
2026-02-25 23:15:05 -07:00
parent b370ba73d6
commit a4a0450071
7 changed files with 473 additions and 10 deletions
+16
View File
@@ -121,6 +121,22 @@ func (p *UserPrefs) Location() *time.Location {
return rc
}
// LocationISO8601Offset returns an offset value for the user's time location.
func (p *UserPrefs) LocationISO8601Offset() string {
loc := p.Location()
_, secondsOut := time.Now().In(loc).Zone()
if secondsOut == 0 {
return "Z"
}
minutesOut := secondsOut / 60
if minutesOut < 0 {
minutesOut = -minutesOut
return fmt.Sprintf("-%02d:%02d", minutesOut/60, minutesOut%60)
} else {
return fmt.Sprintf("+%02d:%02d", minutesOut/60, minutesOut%60)
}
}
// User represents a user in the Amsterdam database.
type User struct {
Mutex sync.RWMutex