a.subtract(1, 'months');
assert.equal(a.fromNow(), 'a year ago', 'Above custom days to years threshold');
moment.relativeTimeThreshold('M', 11);
+
+ // multiple thresholds
+ moment.relativeTimeThreshold('ss', 3);
+ a = moment();
+ a.subtract(4, 'seconds');
+ assert.equal(a.fromNow(), '4 seconds ago', 'Before setting s relative time threshold');
+ moment.relativeTimeThreshold('s', 59);
+ assert.equal(a.fromNow(), 'a few seconds ago', 'After setting s relative time threshold');
+ moment.relativeTimeThreshold('ss', 44);
+ moment.relativeTimeThreshold('s', 45);
});
test('custom rounding', function (assert) {