Due date is stored as UTC midnight: invoices go "overdue" early and can display the wrong day

Aperta
#7 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@nilhn9660 ci sta già lavorando.

Dal 22/11/2026.

  • #103 di @nilhn9660 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start by reproducing the bug: run the app or tests with TZ=America/Los_Angeles (and a UTC+ zone) against an invoice due today, and watch the dashboard and InvoiceCard labels. Then find every place that builds the due timestamp from the picked date string (the Create form and the preview both do) and the two duplicated overdue comparisons, and consolidate them into one dueDateToUnix() and one isOverdue(invoice) helper. Done means both acceptance criteria hold: due today stays not-Overdue until local end of day, and the displayed date matches the picked date across TZ= variations — note the test coverage is blocked on #13, so verify manually until then.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug difficulty: beginner help wanted web

Difficulty: Beginner

Description

new Date("YYYY-MM-DD") parses as UTC midnight. The overdue logic compares against Date.now(), so an invoice is flagged Overdue at the very start of its due day (UTC). In UTC-minus timezones, formatDate can show the previous day. The overdue check is also duplicated in the dashboard and InvoiceCard.

Implementation suggestions

Build the timestamp as the end of the chosen day in the user's local timezone. Share one dueDateToUnix() helper between Create and the preview. Use one isOverdue(invoice) helper in the dashboard and InvoiceCard.

Acceptance criteria

  • An invoice due today is not Overdue until the day has ended.
  • The displayed due date equals the picked date in any timezone (tested with TZ= variations).

Dependencies / related

Tests land with #13.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
54m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Yormee-103/PayLoop

Tutte le issue di Yormee-103/PayLoop

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.