Fix negative time duration
This commit is contained in:
parent
9c75378310
commit
c96db56f33
1 changed files with 1 additions and 0 deletions
|
@ -57,6 +57,7 @@ export function getTimeAgoStr(date: any, showFutureDate?: boolean, genericSecond
|
||||||
// negative duration === it's a future date from now
|
// negative duration === it's a future date from now
|
||||||
if (duration < 0 && showFutureDate) {
|
if (duration < 0 && showFutureDate) {
|
||||||
str = suffix === 'seconds' ? 'in a few seconds' : 'in %duration% ' + suffix;
|
str = suffix === 'seconds' ? 'in a few seconds' : 'in %duration% ' + suffix;
|
||||||
|
duration = duration * -1;
|
||||||
} else if (duration <= 0) {
|
} else if (duration <= 0) {
|
||||||
str = 'Just now';
|
str = 'Just now';
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue