fix: migration
This commit is contained in:
@@ -94,6 +94,11 @@ const fallbackTZ = "Asia/Kolkata"
|
||||
// genuine UTC user re-reports their real zone on next load.
|
||||
func (s *SadhnaService) resolveTZ(ctx context.Context, userID string) (string, *time.Location) {
|
||||
tz, _ := s.logs.UserTimezone(ctx, userID)
|
||||
// Canonicalize legacy aliases (e.g. stored "Asia/Calcutta") — the name
|
||||
// is fed into SQL AT TIME ZONE, which rejects aliases on a Postgres
|
||||
// without the tzdata backward links. Covers rows written before
|
||||
// SetTimezone started canonicalizing.
|
||||
tz = canonicalTZ(tz)
|
||||
if tz == "" || tz == "UTC" {
|
||||
tz = fallbackTZ
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user