fix(email): display host timezone in host-targeted emails#120
Merged
Conversation
Times in host emails were rendered in the guest's wall-clock with no TZ label, so a Paris host seeing a Los Angeles booking would read "07:00" thinking it was Paris time. Now the host's emails show "16:00 (Europe/Paris)" and the guest's cancellation/decline emails gain the TZ label they were already missing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review caught that two paths fed host-tz-stored times straight into BookingDetails/RescheduleDetails (whose contract is guest-tz wall-clock): - run_reminder_loop pulled start_at/end_at raw from the db and labeled them with guest_timezone. host_time_display then double-converted — a 16:00 Paris booking displayed as "01:00 next day" in the host reminder. - guest_reschedule_booking extracted old_*_time the same way and mixed them with form-derived new_*_time. The "Previous" line in the host's reschedule-request email had wrong wall-clock. Both now run through booking_strings_in_guest_tz first (matching cancel/confirm/decline handlers). As a bonus this also fixes a pre-existing latent bug where the guest reminder was already showing host-tz wall-clock under a guest-tz label. Side fixes: - host_reschedule_booking switched from user.timezone to get_host_tz for consistency with the other 15 call sites. - BookingDetails::host_timezone doc comment updated to reflect that most call sites pass the event-type tz (via get_host_tz), not users.timezone directly. - New regression test stored_to_host_email_recovers_host_wall_clock pins the end-to-end pipeline: stored host-tz → guest-tz via booking_strings_in_guest_tz → host wall-clock via host_time_display. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
olivierlambert
added a commit
that referenced
this pull request
May 26, 2026
Patch release for #120 — host emails now display the host's wall-clock with a TZ label, and the reminder/reschedule paths stopped feeding host-tz-stored times into guest-tz-labeled struct fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(TZ)suffix, e.g.16:00 – 16:30 (Europe/Paris)(TZ)label they were missing — confirmation/pending already had itImplementation
BookingDetails,CancellationDetails,RescheduleDetailsget a newhost_timezone: Stringfield (empty string preserves legacy behavior)src/email.rs:convert_time_between_tz(handles date rollover — e.g. LA 22:00 → Paris 07:00 next day) andhost_time_display(returns(date, formatted_time))src/web/mod.rs,src/commands/booking.rs,src/commands/sync.rspopulatehost_timezone— mostly from the already-in-scopehost_tz/stored_tz(event-type timezone viaget_host_tz), with a couple of query extensions to fetchusers.timezoneTest plan
cargo buildcargo clippy --all-targets -- -D warningscargo fmt --checkcargo test(676 passing, including 6 new tests)🤖 Generated with Claude Code