Give Announcements date fields a timezone picker defaulting to the center's timezone
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 50/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- next.js, typescript
Direzione di ricerca
Start with src/collections/Announcements/index.ts and src/fields/startAndEndDateField/components/InitialTimezoneSetter.tsx, then review the dependency branch for the existing center timezone picker and setter behavior. Generate types, create the migration, and update the announcements seed; verify the additive migration with pnpm migrate:check and run the listed checks. Done means all acceptance criteria pass, including tests for the announcement field paths; wait for #1295 to merge before rebasing onto main.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #1295 — Hardcode each center's timezone and default new event dates to it. Split out so the schema change ships on its own.
Problem
Announcements' startDate, endDate, and publishedAt are day-and-time fields with no timezone picker. The admin picker silently uses the editor's browser zone, so an editor in Mountain time who sets "show from 6:00 AM" for a Pacific center gets 6am Mountain, which is 5am for the center's readers. These fields drive visibility windows, so the mistake is user-facing.
Events and Courses already have the picker. #1295 makes it default to the center's timezone from AVALANCHE_CENTERS and flags when the chosen zone differs from the browser's. Announcements should get the same.
What to build
- Add
timezone: { supportedTimezones: TIMEZONE_OPTIONS }to the three Announcements date fields (src/collections/Announcements/index.ts). - Generalize the tenant-default setter in
src/fields/startAndEndDateField/components/InitialTimezoneSetter.tsxso it takes its field paths as props instead of being hardwired to the event fields, and mount it on Announcements withstartDate_tzdrivingendDate_tzandpublishedAt_tz. Events must keep behaving exactly as they do now. pnpm generate:types, thenpnpm payload migrate:create add_announcement_timezones. Expect six additiveADD COLUMN ... textstatements: three onannouncements, three on_announcements_vbecause the collection has drafts. Runpnpm migrate:check.- Update the announcements seed to set the
_tzfields and confirmpnpm seedcompletes.
Why no data migration
The stored value is already a UTC instant and _tz is only a display label. Existing rows keep a null _tz, getActiveAnnouncements and isExpired keep comparing instants unchanged, and the setter fills the center zone the next time someone opens the doc. A backfill of each tenant's zone is optional.
Dependencies
Branch from busbyk/plan-771-afp-drift-warnings until #1295 merges, then rebase and open against main. The center timezone constant, the America/Phoenix picker option, and the setter all live there.
Acceptance criteria
- Announcements show a timezone picker on all three date fields, defaulting to the selected center's zone
- The browser-mismatch note from #1295 appears on Announcements when the zones differ
- Events and Courses behave exactly as before
- Migration is additive only and
pnpm migrate:checkis clean - Tests cover the generalized setter with the announcement field paths
-
pnpm tsc,pnpm lint,pnpm test,pnpm fallow:audit,pnpm drift:checkpass
Related
- #1295 — Hardcode each center's timezone and default new event dates to it
- #771 — Explicit timezones
- #1292 — Announcements pins every /[center] route to a 60-second ISR window, so revalidate = 3600 has never taken effect. Different problem, same fields: that issue is about when the site notices a
startDateorendDateboundary passing; this one is about the boundary being the instant the editor meant. If #1292 lands a scheduler that fires at those boundaries, this issue is what makes the boundary correct. - ADR 020 (
docs/decisions/020-center-timezone-is-a-hardcoded-fact.mdon the #1295 branch) for why the default comes from a hardcoded constant
- Lingua principale
- TypeScript
- Stelle
- 6
- Fork
- 2
- Merge medio
- 1g 11h
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NWACus/web
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement needs-triage tenant:a3
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NWACus/web#1190 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NWACus/web#1154 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Media browser returns "Not found" for repositories using the SHA-256 object formatForse già presa @adamchodera l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Follow-ups from #312Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
janhesters/remixcn#318 ·
I maintainer di solito rispondono entro 1 giorno
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
danielmiessler/LifeOS#3150 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·