mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2024-11-27 09:45:38 -05:00
Changed the value passed to the substitution functions from abs to signed
Instead of passing only possitive millisecond values to string substitution functions, now a signed millisecond value is passed. Negative impies a future timestamp. Postive implies a past timestamp. This might seem a little backward, but the plugin is called "timeago" afterall.
This commit is contained in:
parent
bda21164a7
commit
d2b2a8bc9e
1 changed files with 1 additions and 2 deletions
|
@ -57,10 +57,9 @@
|
||||||
prefix = $l.prefixFromNow;
|
prefix = $l.prefixFromNow;
|
||||||
suffix = $l.suffixFromNow;
|
suffix = $l.suffixFromNow;
|
||||||
}
|
}
|
||||||
distanceMillis = Math.abs(distanceMillis);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var seconds = distanceMillis / 1000;
|
var seconds = Math.abs(distanceMillis) / 1000;
|
||||||
var minutes = seconds / 60;
|
var minutes = seconds / 60;
|
||||||
var hours = minutes / 60;
|
var hours = minutes / 60;
|
||||||
var days = hours / 24;
|
var days = hours / 24;
|
||||||
|
|
Loading…
Reference in a new issue