Skip to content

fix(wallet): export tx history CSV timestamps as UTC (#1613) - #1615

Merged
theborakompanioni merged 1 commit into
joinmarket-webui:develfrom
Gurkaran18:fix/tx-history-csv-utc-timestamps
Nov 4, 2026
Merged

theborakompanioni merged 1 commit into
joinmarket-webui:develfrom
Gurkaran18:fix/tx-history-csv-utc-timestamps

Conversation

@Gurkaran18

Copy link
Copy Markdown
Contributor

What does this PR do?

The transaction history CSV wrote the raw timestamp from the API, which has no offset (e.g. 2026-10-31T13:10:05). Since #1543 these timestamps are treated as UTC: the table converts them to local time, and the Earn report CSV writes them with toISOString(). In the tx history CSV nothing said it was UTC, so the time read as local time and didn't match the table (5.5 h off in Asia/Kolkata).

  • Moves the table's timestamp parsing (no offset → UTC) into txHistoryUtils.ts as parseHistoryTimestamp. TxHistoryTable now imports it, so the table and the CSV use the same logic. No change to what the table displays.
  • txHistoryToCsv writes the parsed timestamp with toISOString(), e.g. 2026-10-31T13:10:05.000Z, like the Earn report CSV. Unparsable values are kept as they are.
  • Note: toISOString() has millisecond precision, so microseconds from the backend (.123456) become .123Z. The Earn report CSV has the same precision.

Tested:

  • New unit tests for parseHistoryTimestamp (no offset, microseconds, explicit Z / +05:30, unparsable) and for the CSV timestamp column. The CSV test fails on devel and passes with this change, in both America/New_York and Asia/Kolkata (the CI time zones).
  • npm run test:unit (171 files, 1193 tests), tsc -b, ESLint and Prettier on the changed files.
  • Manually on regtest (joinmarket-ng, Chrome, Asia/Kolkata): the table still shows 31/10/2026, 6:40:05 pm, and the CSV now has 2026-10-31T13:10:05.000Z, which is the same moment.

Visual Demo

Image Demo :

Same transaction, table vs. downloaded CSV, before and after:

pr1613-csv-timestamp-before-after

@theborakompanioni
theborakompanioni merged commit 71fe3d6 into joinmarket-webui:devel Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tx history CSV exports timestamps without a time zone, so they don't match the table

2 participants