Format dates with the app's locale instead of toLocaleDateString()
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, react, typescript
- Ambito
- frontend, internationalization, localization
Direzione di ricerca
Start by running the grep in the issue to list the 13 toLocaleDateString()/toLocaleString() calls, mostly in src/components/repo-analytics/, PRMetrics.tsx, GoalTracker.tsx and MilestonePlanner.tsx. Check how next-intl supplies the locale through useLocale() on the client and getLocale() on the server, then add the shared formatDate helper under src/lib/ using Intl.DateTimeFormat. Done when the grep returns nothing and the helper's unit tests pass, including a case near midnight UTC.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
13 places call toLocaleDateString() / toLocaleString() with no locale, so dates follow the browser's language, not the language picked in DevTrack, and the server and client can render different text (hydration warnings).
Where
grep -rnE "toLocale(Date|Time)?String\(\)" src --include=*.tsx
Most are in src/components/repo-analytics/, PRMetrics.tsx, GoalTracker.tsx and MilestonePlanner.tsx.
Expected outcome
A small shared helper (e.g. formatDate(date, locale, options) in src/lib/) built on Intl.DateTimeFormat, used everywhere, with the locale coming from next-intl (useLocale() on the client, getLocale() on the server). Pass timeZone: "UTC" wherever a date-only value is shown, so it doesn't shift by a day.
Acceptance criteria
- No bare
toLocale*String()calls left - Unit tests for the helper, including a date near midnight UTC
- Lingua principale
- TypeScript
- Stelle
- 246
- Fork
- 436
- Merge medio
- 9h 33m
- PR unite (30g)
- 213
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la 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 Priyanshu-byte-coder/devtrack
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Priyanshu-byte-coder/devtrack#4067 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Priyanshu-byte-coder/devtrack#4066 ·
I maintainer di solito rispondono entro 1 giorno
-
Webhook manager: replace the browser confirm() dialogs with ConfirmModalForse già presa @Nandaninaulaa l’ha presa 4 giorni fa. Apertagood first issue level 1 level:beginner status:assigned type:design
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Priyanshu-byte-coder/devtrack#3889 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Goals form: square arcade buttons for recurrence, Create goal and RefreshForse già presa @KartikeyG-world l’ha presa 4 giorni fa. Apertagood first issue level 1 level:beginner status:assigned type:design
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Priyanshu-byte-coder/devtrack#3877 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Goals: the error banner and the "No goals yet" hint show at the same timeForse già presa @KartikeyG-world l’ha presa 4 giorni fa. Apertagood first issue level 1 level:beginner status:assigned type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Priyanshu-byte-coder/devtrack#3872 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Priyanshu-byte-coder/devtrack
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
makecindy/cindy#15342 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
kwitsch/claude-code-plugin-tooling#219 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
no-repo-link tool-submission
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100