From: Iskren Chernev Date: Sat, 11 Mar 2017 22:00:18 +0000 (+0200) Subject: Remove s/ss global flag X-Git-Tag: 2.18.0~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38844ac5f6b2daaf652c93244693e46c194be812;p=thirdparty%2Fmoment.git Remove s/ss global flag --- diff --git a/src/lib/duration/humanize.js b/src/lib/duration/humanize.js index e28eeea47..454b01ae5 100644 --- a/src/lib/duration/humanize.js +++ b/src/lib/duration/humanize.js @@ -1,7 +1,6 @@ import { createDuration } from './create'; var round = Math.round; -var secondsThresholdChanged = false; var thresholds = { ss: 44, // a few seconds to seconds s : 45, // seconds to minute @@ -63,12 +62,10 @@ export function getSetRelativeTimeThreshold (threshold, limit) { if (limit === undefined) { return thresholds[threshold]; } - if (threshold === 's' && !secondsThresholdChanged) { + thresholds[threshold] = limit; + if (threshold === 's') { thresholds.ss = limit - 1; - } else if (threshold === 'ss') { - secondsThresholdChanged = true; } - thresholds[threshold] = limit; return true; }