mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
The bulk market data update endpoint parses the incoming date with parseISO, which interprets a date-only string as LOCAL midnight. The data gathering path stores market data at UTC midnight via resetHours. On a server running in any time zone other than UTC the two therefore disagree, and because MarketData is keyed on (dataSource, date, symbol) the upsert misses the existing row and a duplicate is created one offset away. Demonstration for the input "2026-08-07": UTC parseISO -> 2026-08-07T00:00:00.000Z matches Europe/Lisbon parseISO -> 2026-08-06T23:00:00.000Z off by -1h America/Sao_Paulo parseISO -> 2026-08-07T03:00:00.000Z off by +3h Asia/Tokyo parseISO -> 2026-08-06T15:00:00.000Z off by -9h Using resetHours(parseDate(date)) yields 2026-08-07T00:00:00.000Z in every zone and matches what market-data.service.ts already writes, so the endpoint now agrees with the rest of the codebase rather than only on UTC hosts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>pull/7567/head
2 changed files with 8 additions and 3 deletions
Loading…
Reference in new issue