FIX: times showing as < 1m instead of blank
This commit is contained in:
parent
66e53f449a
commit
33feb62673
|
@ -130,6 +130,8 @@ function wrapAgo(dateStr) {
|
|||
}
|
||||
|
||||
export function durationTiny(distance, ageOpts) {
|
||||
if (typeof(distance) !== 'number') { return '—'; }
|
||||
|
||||
const dividedDistance = Math.round(distance / 60.0);
|
||||
const distanceInMinutes = (dividedDistance < 1) ? 1 : dividedDistance;
|
||||
|
||||
|
|
|
@ -214,6 +214,8 @@ QUnit.test("number", assert => {
|
|||
});
|
||||
|
||||
QUnit.test("durationTiny", assert => {
|
||||
assert.equal(durationTiny(), '—', "undefined is a dash");
|
||||
assert.equal(durationTiny(null), '—', "null is a dash");
|
||||
assert.equal(durationTiny(0), '< 1m', "0 seconds shows as < 1m");
|
||||
assert.equal(durationTiny(59), '< 1m', "59 seconds shows as < 1m");
|
||||
assert.equal(durationTiny(60), '1m', "60 seconds shows as 1m");
|
||||
|
|
Loading…
Reference in New Issue