5
11
Fork
You've already forked tomato
1

Use time zone when calculating receipt totals #164

Manually merged
edwardloveall merged 1 commit from el-receipt-total-zone into main 2026年06月01日 16:57:36 +02:00

Yet another time zone bug. This time, receipt totals were not matching the monthly totals displayed on the site. Receipts were using UTC times so if an event happened late in the day such that it would be the next day in UTC, it would be counted or missed incorrectly depending on the receipt date range.

This changes the date range to actually be a date instead of a time masquerading as a date, and then fixed the time zone bug.

Yet another time zone bug. This time, receipt totals were not matching the monthly totals displayed on the site. Receipts were using UTC times so if an event happened late in the day such that it would be the next day in UTC, it would be counted or missed incorrectly depending on the receipt date range. This changes the date range to actually be a date instead of a time masquerading as a date, and then fixed the time zone bug.
edwardloveall force-pushed el-receipt-total-zone from f3beec020f
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
to 9afe7abeed
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
2026年05月27日 22:01:28 +02:00
Compare
jsilasbailey left a comment
Copy link

Glad that this was not for persisted data lol, nice find

Glad that this was not for persisted data lol, nice find
@ -0,0 +5,4 @@
organization = create(:organization, time_zone: "America/Denver")
site = create(:donor, organization:)
task = create(:task, :pickup, site:)
month_border = Time.use_zone("America/Denver") { Time.zone.local(2026, 5, 1) }
First-time contributor
Copy link

nit: I had to look this up, and not sure its any more elegant but to me indexing the zone and calling local on it is a little more clear than the use_zone block

ActiveSupport::TimeZone["America/Denver"].local(2026, 5, 1)

nit: I had to look this up, and not sure its any more elegant but to me indexing the zone and calling local on it is a little more clear than the `use_zone` block `ActiveSupport::TimeZone["America/Denver"].local(2026, 5, 1)`
Author
Owner
Copy link

Yup, that is nicer for grabbing one-off times in a zone. I'm used to use_zone because it's what we wrap every request with. Anyway, updated.

Yup, that is nicer for grabbing one-off times in a zone. I'm used to `use_zone` because it's what we [wrap every request](https://codeberg.org/rootable/tomato/src/commit/ed312a9e/app/controllers/application_controller.rb#L25) with. Anyway, updated.
edwardloveall force-pushed el-receipt-total-zone from 9afe7abeed
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to e0e6b5598d
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
2026年06月01日 15:31:37 +02:00
Compare
edwardloveall force-pushed el-receipt-total-zone from e0e6b5598d
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
to 967b0d4465
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
2026年06月01日 16:18:05 +02:00
Compare
edwardloveall force-pushed el-receipt-total-zone from 967b0d4465
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to 5ea3b1a36a
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
2026年06月01日 16:50:49 +02:00
Compare
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!164
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-receipt-total-zone"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?