Redmine "Logged" Suggestion Chip Shows One Day Early West of UTC

Aperta Adatta ai principianti
#579 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend, testing

Direzione di ricerca

Inizia da src/features/tickets/redmine/suggestions.ts e analizza la gestione da parte di reasonLabel del valore lastTimeLoggedAt contenente solo la data. Esegui il test unitario esistente, quindi aggiungi la copertura usando il literal '2026-09-24' con TZ=America/New_York e TZ=UTC. Il lavoro è completato quando il tempo registrato oggi viene etichettato come "Logged today" in entrambi i fusi orari.

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

Descrizione

bug High Priority ui web

Overview

The "Logged" reason chip on Redmine search suggestions shows a day too early for anyone west of UTC. Time logged this morning reads "Logged yesterday", and yesterday's reads "Logged 2 days ago". Found in the review of #571; it is the one item holding that PR's merge.

Image

Current State

  • lastTimeLoggedAt is Redmine's spent_on, passed through as a bare YYYY-MM-DD with no time zone.
  • reasonLabel in src/features/tickets/redmine/suggestions.ts reads it with Date.parse('2026-09-24'), which is UTC midnight, then compares calendar days in local time.
  • West of UTC those land on different days:
    • TZ=UTC, spent_on 2026-09-25 → "today" ✓
    • TZ=America/New_York, spent_on 2026-09-25 → "yesterday" ✗
    • TZ=Asia/Kolkata, spent_on 2026-09-25 → "today" ✓
  • The unit test passes because it feeds a full local timestamp, not the date-only shape the server sends.

Proposed Changes

  1. Read spent_on as a calendar date
    • Parse the YYYY-MM-DD parts into a local date (e.g. a loggedDay() helper) instead of Date.parse.
  2. Test the real shape
    • Add a unit test built from a literal '2026-09-24'.
    • Run it under TZ=America/New_York so it fails before the fix and passes after.

Acceptance Criteria

  • Time logged today reads "Logged today" in every time zone
  • A unit test built from a date-only string passes under TZ=America/New_York and TZ=UTC

Out of Scope (for Now)

  • Other date displays in the app
  • Changing what the server sends for lastTimeLoggedAt

Fix lands in #571.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
1g 16h
PR unite (30g)
47

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 mieweb/timehuddle

Tutte le issue di mieweb/timehuddle

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.