Closed mboneil10 closed 6 years ago
Before
After
Did I do this correctly? Or should the EDT
change to 4:01 PM
in the above case?
Did I do this correctly? Or should the
EDT
change to4:01 PM
in the above case?
We should drop seconds from both the current time and the EDT/SDT ~when~ before calculating an interval. Does this do that?
No, it only drops seconds for EDT. I'll do it for SDT too.
Question: if the current time is 2:00:59 PM, and we trim the EDT to 2:06:00 PM, how does moment's fromNow
display that? 6 minutes? or 5 minutes?
@dfaulken I don't know and I'm unsure of how to check.
I think the best way is to insert a debugger into the relevant code and construct some of your own moment
objects.
To answer your question from three months ago, @dfaulken... the situation you described displays five minutes.
I did some bs in the code:
const a = moment('2016-01-01 14:00:59');
const b = moment('2016-01-01 14:06:00');
console.log(a.from(b));
Produced:
console.log: 5 minutes ago
Assuming that from(now)
is equivalent to fromNow
, anyway.
All that for two lines of code to change.
A very important two lines 😛
Closes #438