SSR based date value calculation
See original GitHub issueSSR based date value calculation
This is kind of similar to https://github.com/ndresx/react-countdown/issues/42 issue but I couldn’t make it work via now
prop.
@ndresx I want to pass down the current time from the server instead of Date.now()
that can be anything based on the user settings. When I add the same timestamp to the now
prop, the countdown stops.
The date
prop calculates the countdown time based on the Date.new()
, is there away I can pass down the current date from the server instead of Date.now()
If I do this, even if the user has an invalid date on their browser, I would still be able to show the right time on the countdown.
any idea?
// Todo: Calculate current time based on the server. Client side can't be valid all the times.
<Countdown
key="countdown"
date={targetTime} // or an option here would make it even easier
now={() => ServerSideCurrentTImeInTimeStamp} // SSR current date
renderer={renderer}
/>
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SSRS Calculate duration between two dates - Stack Overflow
I'm getting a run time error in expression - conversion from string "29/01/2015 14:00" to type 'Date' is not valid. · I took...
Read more >Calculate Value based on Days in Month - MSDN - Microsoft
I am looking to calculate budget values based on days in a month. ... multiply the result by the number of days in...
Read more >SSRS Report Builder Part 7.6 - Calculating Date Parts
By Andrew GouldIf you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos, you can click this...
Read more >What is SSRS DateDiff? - eduCBA
In SSRS reports, calculate the number of days for just a case that is produced for a specific problem type/case subtype that is...
Read more >SSRS Commonly Required Date Expressions - Devin Knight
Argument, Description ; Interval, This is the interval you want to add (Ex. Days, Months, Years…) ; Number, Numeric value that represents the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, you would have to calculate the difference between
Date.now()
andServerSideCurrentTImeInTimeStamp
, and then basically say thatnow
equalsDate.now()
+ this difference.now
is called every second, so the value it returns needs to be a dynamic value, not a static one.Thank You, I’ll give it a shot.