-
-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
Description
What's the best way of handling when the server and client times differ? For example, if the clients clock is 5 mins behind, it would show 'in 5 minutes' instead of 'just now' which looks wrong.
I tried to enter a relative date like timeago('2016-06-10 12:12:12')
, but after doing so it seems that the real-time updating no longer works. I believe this is because the diffSec function uses that date as the base to compare against rather than new Date().
// calculate the diff second between date to be formated an now date.
function diffSec(date, nowDate) {
nowDate = nowDate ? toDate(nowDate) : new Date();
return (nowDate - toDate(date)) / 1000;
}
If this isn't possible currently, perhaps if a relative date is entered, it should instead store an offset against new Date()
and use that when working out the difference?
aprilmintacpineda and ingria
Metadata
Metadata
Assignees
Labels
No labels