-
Notifications
You must be signed in to change notification settings - Fork 110
Fix timezone handling in tender offer participation #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Use UTC for consistent date comparisons in isFuture/isPast checks - Update tRPC validation to use UTC for tender offer date ranges - Ensure backend uses UTC explicitly in Time.current comparison - Fixes issue where tender offers appeared closed/open inconsistently based on user timezone Co-Authored-By: sahil.lavingia@gmail.com <sahil.lavingia@gmail.com>
Original prompt from sahil.lavingia@gmail.com:
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ BugBot reviewed your changes and found no bugs!
Was this report helpful? Give feedback by reacting with 👍 or 👎
Fix timezone handling in tender offer participation
Problem
Users were unable to participate in tender offers (buybacks) due to timezone inconsistencies between frontend and backend date comparisons. The
isFuture
function on the frontend compared dates against local browser time, while the backend used server timezone, causing tender offers to appear closed on the frontend but open on the backend (or vice versa).Solution
isFuture
andisPast
checks in tender offer page to use UTC withutc()
wrapperTenderOffer#open?
method withTime.current.utc
Changes
frontend/app/equity/tender_offers/[id]/page.tsx
: Use UTC for tender offer open/closed status checkfrontend/trpc/routes/tenderOffers/bids.ts
: Use UTC for date range validation in bid operationsbackend/app/models/tender_offer.rb
: Explicitly use UTC inopen?
methodTesting
formatServerDate
utilityLink to Devin run
https://app.devin.ai/sessions/adf2377cad0049529110c91ed7ef87d6
Requested by: sahil.lavingia@gmail.com