Fix(UI): Synchronize campaign timeline with client real-time and display exact hours - #64
Open
Dedenwrg wants to merge 2 commits into
Open
Fix(UI): Synchronize campaign timeline with client real-time and display exact hours#64Dedenwrg wants to merge 2 commits into
Dedenwrg wants to merge 2 commits into
Conversation
👷 Deploy request for ckboost pending review.Visit the deploys page to approve it
|
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.
This PR addresses an issue where the campaign submission form closes prematurely, and the progress bar jumps to 100% due to timezone/SSR mismatches.
Previously, the UI relied on a static
new Date()evaluated during server-side rendering (SSR). This caused the timeline to freeze on the server's time/cache, leading to inaccurate submission rules and progress calculations for participants in different time zones.Changes Made
const now = new Date()with auseStateanduseEffecthook. This ensures the current time is strictly synchronized in real-time with the participant's local device.formatDateConsistentwith a newformatExactTimehelper for theStartedandEndsdisplays. The UI now explicitly shows precise hours, minutes, and local timezone (e.g., Aug 27, 2026, 05:36 PM (Local Time)) to eliminate ambiguity.!nowcheck to the loading state to ensure the UI gracefully waits for client hydration before rendering time-sensitive components.Expected Behavior
EndsandStarteddates will now display the exact hour and minute.Campaign Progressbar will update live and accurately reflect the user's real local time.