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

Abierto
#7 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@nilhn9660 ya está trabajando en esto.

Desde el 22/11/2026.

  • #103 de @nilhn9660 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
67/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
4
Merge medio
54 min
PR fusionados (30 d)
6

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Yormee-103/PayLoop

Todos los issues de Yormee-103/PayLoop

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.