javascript - Showing update time like Twitter's update notification -
i using momentjs finding difference specific date below:
moment([mydate]).fromnow();
the code gives me results below:
"a few minutes ago" or "10 hours ago" ...
i tried change below find difference seconds
moment([mydate]).fromnow().asseconds();
but code doesn't work.
so implement codes twitter's last update notification. suggestion?
if want make diff between 2 dates in seconds : moment().diff(mydate, 'seconds')
Comments
Post a Comment