Skip to content

Fix commission export dates appearing a day early - #4784

Closed
steven-tey wants to merge 1 commit into
mainfrom
cursor/commissions-export-timezone-4a73
Closed

steven-tey wants to merge 1 commit into
mainfrom
cursor/commissions-export-timezone-4a73

Conversation

@steven-tey

Copy link
Copy Markdown
Collaborator

Summary

Filtering commissions for Oct 8–12 showed the right rows in the table, but the CSV listed some of those same commissions as Oct 7.

createdAt, updatedAt, and paidAt were written with toISOString(), which is always UTC. The table formats those timestamps in the browser timezone. A commission at Oct 8, 6:59am in China (UTC+8) was exported as 2026-10-07 22:59:59.

The export request already sends that timezone (it is used for the date filter). Date columns are now written as wall-clock time in that timezone, for both the immediate download and the background export. Missing or invalid timezones still fall back to UTC.

Test plan

  • formatCommissionsForExport converts 2026-10-07T22:59:59Z to 2026-10-08 06:59:59 in Asia/Shanghai
  • The same instant formats as 2026-10-07 15:59:59 in America/Los_Angeles (PDT)
  • Missing and invalid timezones stay on UTC, and a null paidAt stays blank
  • Export commissions with an Oct 8–12 filter from a timezone ahead of UTC and confirm the CSV dates match the table

Slack Thread

Open in Web Open in Cursor 

CSV date columns used toISOString(), so they were always UTC while the commissions table shows the browser timezone. Early-morning local commissions then looked like the day before the selected filter. Format createdAt, updatedAt, and paidAt in the timezone already sent with the export.

Co-authored-by: Steven Tey <steven@dub.co>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@steven-tey steven-tey closed this Oct 25, 2026
@devkiran
devkiran deleted the cursor/commissions-export-timezone-4a73 branch October 26, 2026 05:07
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.

3 participants