Edit File by line
/home/barbar84/www/wp-inclu.../js/dist/vendor
File: moment.js
[3000] Fix | Delete
if (locale === true || locale === false) {
[3001] Fix | Delete
strict = locale;
[3002] Fix | Delete
locale = undefined;
[3003] Fix | Delete
}
[3004] Fix | Delete
[3005] Fix | Delete
if (
[3006] Fix | Delete
(isObject(input) && isObjectEmpty(input)) ||
[3007] Fix | Delete
(isArray(input) && input.length === 0)
[3008] Fix | Delete
) {
[3009] Fix | Delete
input = undefined;
[3010] Fix | Delete
}
[3011] Fix | Delete
// object construction must be done this way.
[3012] Fix | Delete
// https://github.com/moment/moment/issues/1423
[3013] Fix | Delete
c._isAMomentObject = true;
[3014] Fix | Delete
c._useUTC = c._isUTC = isUTC;
[3015] Fix | Delete
c._l = locale;
[3016] Fix | Delete
c._i = input;
[3017] Fix | Delete
c._f = format;
[3018] Fix | Delete
c._strict = strict;
[3019] Fix | Delete
[3020] Fix | Delete
return createFromConfig(c);
[3021] Fix | Delete
}
[3022] Fix | Delete
[3023] Fix | Delete
function createLocal(input, format, locale, strict) {
[3024] Fix | Delete
return createLocalOrUTC(input, format, locale, strict, false);
[3025] Fix | Delete
}
[3026] Fix | Delete
[3027] Fix | Delete
var prototypeMin = deprecate(
[3028] Fix | Delete
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
[3029] Fix | Delete
function () {
[3030] Fix | Delete
var other = createLocal.apply(null, arguments);
[3031] Fix | Delete
if (this.isValid() && other.isValid()) {
[3032] Fix | Delete
return other < this ? this : other;
[3033] Fix | Delete
} else {
[3034] Fix | Delete
return createInvalid();
[3035] Fix | Delete
}
[3036] Fix | Delete
}
[3037] Fix | Delete
),
[3038] Fix | Delete
prototypeMax = deprecate(
[3039] Fix | Delete
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
[3040] Fix | Delete
function () {
[3041] Fix | Delete
var other = createLocal.apply(null, arguments);
[3042] Fix | Delete
if (this.isValid() && other.isValid()) {
[3043] Fix | Delete
return other > this ? this : other;
[3044] Fix | Delete
} else {
[3045] Fix | Delete
return createInvalid();
[3046] Fix | Delete
}
[3047] Fix | Delete
}
[3048] Fix | Delete
);
[3049] Fix | Delete
[3050] Fix | Delete
// Pick a moment m from moments so that m[fn](other) is true for all
[3051] Fix | Delete
// other. This relies on the function fn to be transitive.
[3052] Fix | Delete
//
[3053] Fix | Delete
// moments should either be an array of moment objects or an array, whose
[3054] Fix | Delete
// first element is an array of moment objects.
[3055] Fix | Delete
function pickBy(fn, moments) {
[3056] Fix | Delete
var res, i;
[3057] Fix | Delete
if (moments.length === 1 && isArray(moments[0])) {
[3058] Fix | Delete
moments = moments[0];
[3059] Fix | Delete
}
[3060] Fix | Delete
if (!moments.length) {
[3061] Fix | Delete
return createLocal();
[3062] Fix | Delete
}
[3063] Fix | Delete
res = moments[0];
[3064] Fix | Delete
for (i = 1; i < moments.length; ++i) {
[3065] Fix | Delete
if (!moments[i].isValid() || moments[i][fn](res)) {
[3066] Fix | Delete
res = moments[i];
[3067] Fix | Delete
}
[3068] Fix | Delete
}
[3069] Fix | Delete
return res;
[3070] Fix | Delete
}
[3071] Fix | Delete
[3072] Fix | Delete
// TODO: Use [].sort instead?
[3073] Fix | Delete
function min() {
[3074] Fix | Delete
var args = [].slice.call(arguments, 0);
[3075] Fix | Delete
[3076] Fix | Delete
return pickBy('isBefore', args);
[3077] Fix | Delete
}
[3078] Fix | Delete
[3079] Fix | Delete
function max() {
[3080] Fix | Delete
var args = [].slice.call(arguments, 0);
[3081] Fix | Delete
[3082] Fix | Delete
return pickBy('isAfter', args);
[3083] Fix | Delete
}
[3084] Fix | Delete
[3085] Fix | Delete
var now = function () {
[3086] Fix | Delete
return Date.now ? Date.now() : +new Date();
[3087] Fix | Delete
};
[3088] Fix | Delete
[3089] Fix | Delete
var ordering = [
[3090] Fix | Delete
'year',
[3091] Fix | Delete
'quarter',
[3092] Fix | Delete
'month',
[3093] Fix | Delete
'week',
[3094] Fix | Delete
'day',
[3095] Fix | Delete
'hour',
[3096] Fix | Delete
'minute',
[3097] Fix | Delete
'second',
[3098] Fix | Delete
'millisecond',
[3099] Fix | Delete
];
[3100] Fix | Delete
[3101] Fix | Delete
function isDurationValid(m) {
[3102] Fix | Delete
var key,
[3103] Fix | Delete
unitHasDecimal = false,
[3104] Fix | Delete
i;
[3105] Fix | Delete
for (key in m) {
[3106] Fix | Delete
if (
[3107] Fix | Delete
hasOwnProp(m, key) &&
[3108] Fix | Delete
!(
[3109] Fix | Delete
indexOf.call(ordering, key) !== -1 &&
[3110] Fix | Delete
(m[key] == null || !isNaN(m[key]))
[3111] Fix | Delete
)
[3112] Fix | Delete
) {
[3113] Fix | Delete
return false;
[3114] Fix | Delete
}
[3115] Fix | Delete
}
[3116] Fix | Delete
[3117] Fix | Delete
for (i = 0; i < ordering.length; ++i) {
[3118] Fix | Delete
if (m[ordering[i]]) {
[3119] Fix | Delete
if (unitHasDecimal) {
[3120] Fix | Delete
return false; // only allow non-integers for smallest unit
[3121] Fix | Delete
}
[3122] Fix | Delete
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
[3123] Fix | Delete
unitHasDecimal = true;
[3124] Fix | Delete
}
[3125] Fix | Delete
}
[3126] Fix | Delete
}
[3127] Fix | Delete
[3128] Fix | Delete
return true;
[3129] Fix | Delete
}
[3130] Fix | Delete
[3131] Fix | Delete
function isValid$1() {
[3132] Fix | Delete
return this._isValid;
[3133] Fix | Delete
}
[3134] Fix | Delete
[3135] Fix | Delete
function createInvalid$1() {
[3136] Fix | Delete
return createDuration(NaN);
[3137] Fix | Delete
}
[3138] Fix | Delete
[3139] Fix | Delete
function Duration(duration) {
[3140] Fix | Delete
var normalizedInput = normalizeObjectUnits(duration),
[3141] Fix | Delete
years = normalizedInput.year || 0,
[3142] Fix | Delete
quarters = normalizedInput.quarter || 0,
[3143] Fix | Delete
months = normalizedInput.month || 0,
[3144] Fix | Delete
weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
[3145] Fix | Delete
days = normalizedInput.day || 0,
[3146] Fix | Delete
hours = normalizedInput.hour || 0,
[3147] Fix | Delete
minutes = normalizedInput.minute || 0,
[3148] Fix | Delete
seconds = normalizedInput.second || 0,
[3149] Fix | Delete
milliseconds = normalizedInput.millisecond || 0;
[3150] Fix | Delete
[3151] Fix | Delete
this._isValid = isDurationValid(normalizedInput);
[3152] Fix | Delete
[3153] Fix | Delete
// representation for dateAddRemove
[3154] Fix | Delete
this._milliseconds =
[3155] Fix | Delete
+milliseconds +
[3156] Fix | Delete
seconds * 1e3 + // 1000
[3157] Fix | Delete
minutes * 6e4 + // 1000 * 60
[3158] Fix | Delete
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
[3159] Fix | Delete
// Because of dateAddRemove treats 24 hours as different from a
[3160] Fix | Delete
// day when working around DST, we need to store them separately
[3161] Fix | Delete
this._days = +days + weeks * 7;
[3162] Fix | Delete
// It is impossible to translate months into days without knowing
[3163] Fix | Delete
// which months you are are talking about, so we have to store
[3164] Fix | Delete
// it separately.
[3165] Fix | Delete
this._months = +months + quarters * 3 + years * 12;
[3166] Fix | Delete
[3167] Fix | Delete
this._data = {};
[3168] Fix | Delete
[3169] Fix | Delete
this._locale = getLocale();
[3170] Fix | Delete
[3171] Fix | Delete
this._bubble();
[3172] Fix | Delete
}
[3173] Fix | Delete
[3174] Fix | Delete
function isDuration(obj) {
[3175] Fix | Delete
return obj instanceof Duration;
[3176] Fix | Delete
}
[3177] Fix | Delete
[3178] Fix | Delete
function absRound(number) {
[3179] Fix | Delete
if (number < 0) {
[3180] Fix | Delete
return Math.round(-1 * number) * -1;
[3181] Fix | Delete
} else {
[3182] Fix | Delete
return Math.round(number);
[3183] Fix | Delete
}
[3184] Fix | Delete
}
[3185] Fix | Delete
[3186] Fix | Delete
// compare two arrays, return the number of differences
[3187] Fix | Delete
function compareArrays(array1, array2, dontConvert) {
[3188] Fix | Delete
var len = Math.min(array1.length, array2.length),
[3189] Fix | Delete
lengthDiff = Math.abs(array1.length - array2.length),
[3190] Fix | Delete
diffs = 0,
[3191] Fix | Delete
i;
[3192] Fix | Delete
for (i = 0; i < len; i++) {
[3193] Fix | Delete
if (
[3194] Fix | Delete
(dontConvert && array1[i] !== array2[i]) ||
[3195] Fix | Delete
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
[3196] Fix | Delete
) {
[3197] Fix | Delete
diffs++;
[3198] Fix | Delete
}
[3199] Fix | Delete
}
[3200] Fix | Delete
return diffs + lengthDiff;
[3201] Fix | Delete
}
[3202] Fix | Delete
[3203] Fix | Delete
// FORMATTING
[3204] Fix | Delete
[3205] Fix | Delete
function offset(token, separator) {
[3206] Fix | Delete
addFormatToken(token, 0, 0, function () {
[3207] Fix | Delete
var offset = this.utcOffset(),
[3208] Fix | Delete
sign = '+';
[3209] Fix | Delete
if (offset < 0) {
[3210] Fix | Delete
offset = -offset;
[3211] Fix | Delete
sign = '-';
[3212] Fix | Delete
}
[3213] Fix | Delete
return (
[3214] Fix | Delete
sign +
[3215] Fix | Delete
zeroFill(~~(offset / 60), 2) +
[3216] Fix | Delete
separator +
[3217] Fix | Delete
zeroFill(~~offset % 60, 2)
[3218] Fix | Delete
);
[3219] Fix | Delete
});
[3220] Fix | Delete
}
[3221] Fix | Delete
[3222] Fix | Delete
offset('Z', ':');
[3223] Fix | Delete
offset('ZZ', '');
[3224] Fix | Delete
[3225] Fix | Delete
// PARSING
[3226] Fix | Delete
[3227] Fix | Delete
addRegexToken('Z', matchShortOffset);
[3228] Fix | Delete
addRegexToken('ZZ', matchShortOffset);
[3229] Fix | Delete
addParseToken(['Z', 'ZZ'], function (input, array, config) {
[3230] Fix | Delete
config._useUTC = true;
[3231] Fix | Delete
config._tzm = offsetFromString(matchShortOffset, input);
[3232] Fix | Delete
});
[3233] Fix | Delete
[3234] Fix | Delete
// HELPERS
[3235] Fix | Delete
[3236] Fix | Delete
// timezone chunker
[3237] Fix | Delete
// '+10:00' > ['10', '00']
[3238] Fix | Delete
// '-1530' > ['-15', '30']
[3239] Fix | Delete
var chunkOffset = /([\+\-]|\d\d)/gi;
[3240] Fix | Delete
[3241] Fix | Delete
function offsetFromString(matcher, string) {
[3242] Fix | Delete
var matches = (string || '').match(matcher),
[3243] Fix | Delete
chunk,
[3244] Fix | Delete
parts,
[3245] Fix | Delete
minutes;
[3246] Fix | Delete
[3247] Fix | Delete
if (matches === null) {
[3248] Fix | Delete
return null;
[3249] Fix | Delete
}
[3250] Fix | Delete
[3251] Fix | Delete
chunk = matches[matches.length - 1] || [];
[3252] Fix | Delete
parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
[3253] Fix | Delete
minutes = +(parts[1] * 60) + toInt(parts[2]);
[3254] Fix | Delete
[3255] Fix | Delete
return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
[3256] Fix | Delete
}
[3257] Fix | Delete
[3258] Fix | Delete
// Return a moment from input, that is local/utc/zone equivalent to model.
[3259] Fix | Delete
function cloneWithOffset(input, model) {
[3260] Fix | Delete
var res, diff;
[3261] Fix | Delete
if (model._isUTC) {
[3262] Fix | Delete
res = model.clone();
[3263] Fix | Delete
diff =
[3264] Fix | Delete
(isMoment(input) || isDate(input)
[3265] Fix | Delete
? input.valueOf()
[3266] Fix | Delete
: createLocal(input).valueOf()) - res.valueOf();
[3267] Fix | Delete
// Use low-level api, because this fn is low-level api.
[3268] Fix | Delete
res._d.setTime(res._d.valueOf() + diff);
[3269] Fix | Delete
hooks.updateOffset(res, false);
[3270] Fix | Delete
return res;
[3271] Fix | Delete
} else {
[3272] Fix | Delete
return createLocal(input).local();
[3273] Fix | Delete
}
[3274] Fix | Delete
}
[3275] Fix | Delete
[3276] Fix | Delete
function getDateOffset(m) {
[3277] Fix | Delete
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
[3278] Fix | Delete
// https://github.com/moment/moment/pull/1871
[3279] Fix | Delete
return -Math.round(m._d.getTimezoneOffset());
[3280] Fix | Delete
}
[3281] Fix | Delete
[3282] Fix | Delete
// HOOKS
[3283] Fix | Delete
[3284] Fix | Delete
// This function will be called whenever a moment is mutated.
[3285] Fix | Delete
// It is intended to keep the offset in sync with the timezone.
[3286] Fix | Delete
hooks.updateOffset = function () {};
[3287] Fix | Delete
[3288] Fix | Delete
// MOMENTS
[3289] Fix | Delete
[3290] Fix | Delete
// keepLocalTime = true means only change the timezone, without
[3291] Fix | Delete
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
[3292] Fix | Delete
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
[3293] Fix | Delete
// +0200, so we adjust the time as needed, to be valid.
[3294] Fix | Delete
//
[3295] Fix | Delete
// Keeping the time actually adds/subtracts (one hour)
[3296] Fix | Delete
// from the actual represented time. That is why we call updateOffset
[3297] Fix | Delete
// a second time. In case it wants us to change the offset again
[3298] Fix | Delete
// _changeInProgress == true case, then we have to adjust, because
[3299] Fix | Delete
// there is no such time in the given timezone.
[3300] Fix | Delete
function getSetOffset(input, keepLocalTime, keepMinutes) {
[3301] Fix | Delete
var offset = this._offset || 0,
[3302] Fix | Delete
localAdjust;
[3303] Fix | Delete
if (!this.isValid()) {
[3304] Fix | Delete
return input != null ? this : NaN;
[3305] Fix | Delete
}
[3306] Fix | Delete
if (input != null) {
[3307] Fix | Delete
if (typeof input === 'string') {
[3308] Fix | Delete
input = offsetFromString(matchShortOffset, input);
[3309] Fix | Delete
if (input === null) {
[3310] Fix | Delete
return this;
[3311] Fix | Delete
}
[3312] Fix | Delete
} else if (Math.abs(input) < 16 && !keepMinutes) {
[3313] Fix | Delete
input = input * 60;
[3314] Fix | Delete
}
[3315] Fix | Delete
if (!this._isUTC && keepLocalTime) {
[3316] Fix | Delete
localAdjust = getDateOffset(this);
[3317] Fix | Delete
}
[3318] Fix | Delete
this._offset = input;
[3319] Fix | Delete
this._isUTC = true;
[3320] Fix | Delete
if (localAdjust != null) {
[3321] Fix | Delete
this.add(localAdjust, 'm');
[3322] Fix | Delete
}
[3323] Fix | Delete
if (offset !== input) {
[3324] Fix | Delete
if (!keepLocalTime || this._changeInProgress) {
[3325] Fix | Delete
addSubtract(
[3326] Fix | Delete
this,
[3327] Fix | Delete
createDuration(input - offset, 'm'),
[3328] Fix | Delete
1,
[3329] Fix | Delete
false
[3330] Fix | Delete
);
[3331] Fix | Delete
} else if (!this._changeInProgress) {
[3332] Fix | Delete
this._changeInProgress = true;
[3333] Fix | Delete
hooks.updateOffset(this, true);
[3334] Fix | Delete
this._changeInProgress = null;
[3335] Fix | Delete
}
[3336] Fix | Delete
}
[3337] Fix | Delete
return this;
[3338] Fix | Delete
} else {
[3339] Fix | Delete
return this._isUTC ? offset : getDateOffset(this);
[3340] Fix | Delete
}
[3341] Fix | Delete
}
[3342] Fix | Delete
[3343] Fix | Delete
function getSetZone(input, keepLocalTime) {
[3344] Fix | Delete
if (input != null) {
[3345] Fix | Delete
if (typeof input !== 'string') {
[3346] Fix | Delete
input = -input;
[3347] Fix | Delete
}
[3348] Fix | Delete
[3349] Fix | Delete
this.utcOffset(input, keepLocalTime);
[3350] Fix | Delete
[3351] Fix | Delete
return this;
[3352] Fix | Delete
} else {
[3353] Fix | Delete
return -this.utcOffset();
[3354] Fix | Delete
}
[3355] Fix | Delete
}
[3356] Fix | Delete
[3357] Fix | Delete
function setOffsetToUTC(keepLocalTime) {
[3358] Fix | Delete
return this.utcOffset(0, keepLocalTime);
[3359] Fix | Delete
}
[3360] Fix | Delete
[3361] Fix | Delete
function setOffsetToLocal(keepLocalTime) {
[3362] Fix | Delete
if (this._isUTC) {
[3363] Fix | Delete
this.utcOffset(0, keepLocalTime);
[3364] Fix | Delete
this._isUTC = false;
[3365] Fix | Delete
[3366] Fix | Delete
if (keepLocalTime) {
[3367] Fix | Delete
this.subtract(getDateOffset(this), 'm');
[3368] Fix | Delete
}
[3369] Fix | Delete
}
[3370] Fix | Delete
return this;
[3371] Fix | Delete
}
[3372] Fix | Delete
[3373] Fix | Delete
function setOffsetToParsedOffset() {
[3374] Fix | Delete
if (this._tzm != null) {
[3375] Fix | Delete
this.utcOffset(this._tzm, false, true);
[3376] Fix | Delete
} else if (typeof this._i === 'string') {
[3377] Fix | Delete
var tZone = offsetFromString(matchOffset, this._i);
[3378] Fix | Delete
if (tZone != null) {
[3379] Fix | Delete
this.utcOffset(tZone);
[3380] Fix | Delete
} else {
[3381] Fix | Delete
this.utcOffset(0, true);
[3382] Fix | Delete
}
[3383] Fix | Delete
}
[3384] Fix | Delete
return this;
[3385] Fix | Delete
}
[3386] Fix | Delete
[3387] Fix | Delete
function hasAlignedHourOffset(input) {
[3388] Fix | Delete
if (!this.isValid()) {
[3389] Fix | Delete
return false;
[3390] Fix | Delete
}
[3391] Fix | Delete
input = input ? createLocal(input).utcOffset() : 0;
[3392] Fix | Delete
[3393] Fix | Delete
return (this.utcOffset() - input) % 60 === 0;
[3394] Fix | Delete
}
[3395] Fix | Delete
[3396] Fix | Delete
function isDaylightSavingTime() {
[3397] Fix | Delete
return (
[3398] Fix | Delete
this.utcOffset() > this.clone().month(0).utcOffset() ||
[3399] Fix | Delete
this.utcOffset() > this.clone().month(5).utcOffset()
[3400] Fix | Delete
);
[3401] Fix | Delete
}
[3402] Fix | Delete
[3403] Fix | Delete
function isDaylightSavingTimeShifted() {
[3404] Fix | Delete
if (!isUndefined(this._isDSTShifted)) {
[3405] Fix | Delete
return this._isDSTShifted;
[3406] Fix | Delete
}
[3407] Fix | Delete
[3408] Fix | Delete
var c = {},
[3409] Fix | Delete
other;
[3410] Fix | Delete
[3411] Fix | Delete
copyConfig(c, this);
[3412] Fix | Delete
c = prepareConfig(c);
[3413] Fix | Delete
[3414] Fix | Delete
if (c._a) {
[3415] Fix | Delete
other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
[3416] Fix | Delete
this._isDSTShifted =
[3417] Fix | Delete
this.isValid() && compareArrays(c._a, other.toArray()) > 0;
[3418] Fix | Delete
} else {
[3419] Fix | Delete
this._isDSTShifted = false;
[3420] Fix | Delete
}
[3421] Fix | Delete
[3422] Fix | Delete
return this._isDSTShifted;
[3423] Fix | Delete
}
[3424] Fix | Delete
[3425] Fix | Delete
function isLocal() {
[3426] Fix | Delete
return this.isValid() ? !this._isUTC : false;
[3427] Fix | Delete
}
[3428] Fix | Delete
[3429] Fix | Delete
function isUtcOffset() {
[3430] Fix | Delete
return this.isValid() ? this._isUTC : false;
[3431] Fix | Delete
}
[3432] Fix | Delete
[3433] Fix | Delete
function isUtc() {
[3434] Fix | Delete
return this.isValid() ? this._isUTC && this._offset === 0 : false;
[3435] Fix | Delete
}
[3436] Fix | Delete
[3437] Fix | Delete
// ASP.NET json date format regex
[3438] Fix | Delete
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
[3439] Fix | Delete
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
[3440] Fix | Delete
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
[3441] Fix | Delete
// and further modified to allow for strings containing both week and day
[3442] Fix | Delete
isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
[3443] Fix | Delete
[3444] Fix | Delete
function createDuration(input, key) {
[3445] Fix | Delete
var duration = input,
[3446] Fix | Delete
// matching against regexp is expensive, do it on demand
[3447] Fix | Delete
match = null,
[3448] Fix | Delete
sign,
[3449] Fix | Delete
ret,
[3450] Fix | Delete
diffRes;
[3451] Fix | Delete
[3452] Fix | Delete
if (isDuration(input)) {
[3453] Fix | Delete
duration = {
[3454] Fix | Delete
ms: input._milliseconds,
[3455] Fix | Delete
d: input._days,
[3456] Fix | Delete
M: input._months,
[3457] Fix | Delete
};
[3458] Fix | Delete
} else if (isNumber(input) || !isNaN(+input)) {
[3459] Fix | Delete
duration = {};
[3460] Fix | Delete
if (key) {
[3461] Fix | Delete
duration[key] = +input;
[3462] Fix | Delete
} else {
[3463] Fix | Delete
duration.milliseconds = +input;
[3464] Fix | Delete
}
[3465] Fix | Delete
} else if ((match = aspNetRegex.exec(input))) {
[3466] Fix | Delete
sign = match[1] === '-' ? -1 : 1;
[3467] Fix | Delete
duration = {
[3468] Fix | Delete
y: 0,
[3469] Fix | Delete
d: toInt(match[DATE]) * sign,
[3470] Fix | Delete
h: toInt(match[HOUR]) * sign,
[3471] Fix | Delete
m: toInt(match[MINUTE]) * sign,
[3472] Fix | Delete
s: toInt(match[SECOND]) * sign,
[3473] Fix | Delete
ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
[3474] Fix | Delete
};
[3475] Fix | Delete
} else if ((match = isoRegex.exec(input))) {
[3476] Fix | Delete
sign = match[1] === '-' ? -1 : 1;
[3477] Fix | Delete
duration = {
[3478] Fix | Delete
y: parseIso(match[2], sign),
[3479] Fix | Delete
M: parseIso(match[3], sign),
[3480] Fix | Delete
w: parseIso(match[4], sign),
[3481] Fix | Delete
d: parseIso(match[5], sign),
[3482] Fix | Delete
h: parseIso(match[6], sign),
[3483] Fix | Delete
m: parseIso(match[7], sign),
[3484] Fix | Delete
s: parseIso(match[8], sign),
[3485] Fix | Delete
};
[3486] Fix | Delete
} else if (duration == null) {
[3487] Fix | Delete
// checks for null or undefined
[3488] Fix | Delete
duration = {};
[3489] Fix | Delete
} else if (
[3490] Fix | Delete
typeof duration === 'object' &&
[3491] Fix | Delete
('from' in duration || 'to' in duration)
[3492] Fix | Delete
) {
[3493] Fix | Delete
diffRes = momentsDifference(
[3494] Fix | Delete
createLocal(duration.from),
[3495] Fix | Delete
createLocal(duration.to)
[3496] Fix | Delete
);
[3497] Fix | Delete
[3498] Fix | Delete
duration = {};
[3499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function