Edit File by line
/home/barbar84/www/wp-inclu.../js/dist/vendor
File: moment.js
duration.ms = diffRes.milliseconds;
[3500] Fix | Delete
duration.M = diffRes.months;
[3501] Fix | Delete
}
[3502] Fix | Delete
[3503] Fix | Delete
ret = new Duration(duration);
[3504] Fix | Delete
[3505] Fix | Delete
if (isDuration(input) && hasOwnProp(input, '_locale')) {
[3506] Fix | Delete
ret._locale = input._locale;
[3507] Fix | Delete
}
[3508] Fix | Delete
[3509] Fix | Delete
if (isDuration(input) && hasOwnProp(input, '_isValid')) {
[3510] Fix | Delete
ret._isValid = input._isValid;
[3511] Fix | Delete
}
[3512] Fix | Delete
[3513] Fix | Delete
return ret;
[3514] Fix | Delete
}
[3515] Fix | Delete
[3516] Fix | Delete
createDuration.fn = Duration.prototype;
[3517] Fix | Delete
createDuration.invalid = createInvalid$1;
[3518] Fix | Delete
[3519] Fix | Delete
function parseIso(inp, sign) {
[3520] Fix | Delete
// We'd normally use ~~inp for this, but unfortunately it also
[3521] Fix | Delete
// converts floats to ints.
[3522] Fix | Delete
// inp may be undefined, so careful calling replace on it.
[3523] Fix | Delete
var res = inp && parseFloat(inp.replace(',', '.'));
[3524] Fix | Delete
// apply sign while we're at it
[3525] Fix | Delete
return (isNaN(res) ? 0 : res) * sign;
[3526] Fix | Delete
}
[3527] Fix | Delete
[3528] Fix | Delete
function positiveMomentsDifference(base, other) {
[3529] Fix | Delete
var res = {};
[3530] Fix | Delete
[3531] Fix | Delete
res.months =
[3532] Fix | Delete
other.month() - base.month() + (other.year() - base.year()) * 12;
[3533] Fix | Delete
if (base.clone().add(res.months, 'M').isAfter(other)) {
[3534] Fix | Delete
--res.months;
[3535] Fix | Delete
}
[3536] Fix | Delete
[3537] Fix | Delete
res.milliseconds = +other - +base.clone().add(res.months, 'M');
[3538] Fix | Delete
[3539] Fix | Delete
return res;
[3540] Fix | Delete
}
[3541] Fix | Delete
[3542] Fix | Delete
function momentsDifference(base, other) {
[3543] Fix | Delete
var res;
[3544] Fix | Delete
if (!(base.isValid() && other.isValid())) {
[3545] Fix | Delete
return { milliseconds: 0, months: 0 };
[3546] Fix | Delete
}
[3547] Fix | Delete
[3548] Fix | Delete
other = cloneWithOffset(other, base);
[3549] Fix | Delete
if (base.isBefore(other)) {
[3550] Fix | Delete
res = positiveMomentsDifference(base, other);
[3551] Fix | Delete
} else {
[3552] Fix | Delete
res = positiveMomentsDifference(other, base);
[3553] Fix | Delete
res.milliseconds = -res.milliseconds;
[3554] Fix | Delete
res.months = -res.months;
[3555] Fix | Delete
}
[3556] Fix | Delete
[3557] Fix | Delete
return res;
[3558] Fix | Delete
}
[3559] Fix | Delete
[3560] Fix | Delete
// TODO: remove 'name' arg after deprecation is removed
[3561] Fix | Delete
function createAdder(direction, name) {
[3562] Fix | Delete
return function (val, period) {
[3563] Fix | Delete
var dur, tmp;
[3564] Fix | Delete
//invert the arguments, but complain about it
[3565] Fix | Delete
if (period !== null && !isNaN(+period)) {
[3566] Fix | Delete
deprecateSimple(
[3567] Fix | Delete
name,
[3568] Fix | Delete
'moment().' +
[3569] Fix | Delete
name +
[3570] Fix | Delete
'(period, number) is deprecated. Please use moment().' +
[3571] Fix | Delete
name +
[3572] Fix | Delete
'(number, period). ' +
[3573] Fix | Delete
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
[3574] Fix | Delete
);
[3575] Fix | Delete
tmp = val;
[3576] Fix | Delete
val = period;
[3577] Fix | Delete
period = tmp;
[3578] Fix | Delete
}
[3579] Fix | Delete
[3580] Fix | Delete
dur = createDuration(val, period);
[3581] Fix | Delete
addSubtract(this, dur, direction);
[3582] Fix | Delete
return this;
[3583] Fix | Delete
};
[3584] Fix | Delete
}
[3585] Fix | Delete
[3586] Fix | Delete
function addSubtract(mom, duration, isAdding, updateOffset) {
[3587] Fix | Delete
var milliseconds = duration._milliseconds,
[3588] Fix | Delete
days = absRound(duration._days),
[3589] Fix | Delete
months = absRound(duration._months);
[3590] Fix | Delete
[3591] Fix | Delete
if (!mom.isValid()) {
[3592] Fix | Delete
// No op
[3593] Fix | Delete
return;
[3594] Fix | Delete
}
[3595] Fix | Delete
[3596] Fix | Delete
updateOffset = updateOffset == null ? true : updateOffset;
[3597] Fix | Delete
[3598] Fix | Delete
if (months) {
[3599] Fix | Delete
setMonth(mom, get(mom, 'Month') + months * isAdding);
[3600] Fix | Delete
}
[3601] Fix | Delete
if (days) {
[3602] Fix | Delete
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
[3603] Fix | Delete
}
[3604] Fix | Delete
if (milliseconds) {
[3605] Fix | Delete
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
[3606] Fix | Delete
}
[3607] Fix | Delete
if (updateOffset) {
[3608] Fix | Delete
hooks.updateOffset(mom, days || months);
[3609] Fix | Delete
}
[3610] Fix | Delete
}
[3611] Fix | Delete
[3612] Fix | Delete
var add = createAdder(1, 'add'),
[3613] Fix | Delete
subtract = createAdder(-1, 'subtract');
[3614] Fix | Delete
[3615] Fix | Delete
function isString(input) {
[3616] Fix | Delete
return typeof input === 'string' || input instanceof String;
[3617] Fix | Delete
}
[3618] Fix | Delete
[3619] Fix | Delete
// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
[3620] Fix | Delete
function isMomentInput(input) {
[3621] Fix | Delete
return (
[3622] Fix | Delete
isMoment(input) ||
[3623] Fix | Delete
isDate(input) ||
[3624] Fix | Delete
isString(input) ||
[3625] Fix | Delete
isNumber(input) ||
[3626] Fix | Delete
isNumberOrStringArray(input) ||
[3627] Fix | Delete
isMomentInputObject(input) ||
[3628] Fix | Delete
input === null ||
[3629] Fix | Delete
input === undefined
[3630] Fix | Delete
);
[3631] Fix | Delete
}
[3632] Fix | Delete
[3633] Fix | Delete
function isMomentInputObject(input) {
[3634] Fix | Delete
var objectTest = isObject(input) && !isObjectEmpty(input),
[3635] Fix | Delete
propertyTest = false,
[3636] Fix | Delete
properties = [
[3637] Fix | Delete
'years',
[3638] Fix | Delete
'year',
[3639] Fix | Delete
'y',
[3640] Fix | Delete
'months',
[3641] Fix | Delete
'month',
[3642] Fix | Delete
'M',
[3643] Fix | Delete
'days',
[3644] Fix | Delete
'day',
[3645] Fix | Delete
'd',
[3646] Fix | Delete
'dates',
[3647] Fix | Delete
'date',
[3648] Fix | Delete
'D',
[3649] Fix | Delete
'hours',
[3650] Fix | Delete
'hour',
[3651] Fix | Delete
'h',
[3652] Fix | Delete
'minutes',
[3653] Fix | Delete
'minute',
[3654] Fix | Delete
'm',
[3655] Fix | Delete
'seconds',
[3656] Fix | Delete
'second',
[3657] Fix | Delete
's',
[3658] Fix | Delete
'milliseconds',
[3659] Fix | Delete
'millisecond',
[3660] Fix | Delete
'ms',
[3661] Fix | Delete
],
[3662] Fix | Delete
i,
[3663] Fix | Delete
property;
[3664] Fix | Delete
[3665] Fix | Delete
for (i = 0; i < properties.length; i += 1) {
[3666] Fix | Delete
property = properties[i];
[3667] Fix | Delete
propertyTest = propertyTest || hasOwnProp(input, property);
[3668] Fix | Delete
}
[3669] Fix | Delete
[3670] Fix | Delete
return objectTest && propertyTest;
[3671] Fix | Delete
}
[3672] Fix | Delete
[3673] Fix | Delete
function isNumberOrStringArray(input) {
[3674] Fix | Delete
var arrayTest = isArray(input),
[3675] Fix | Delete
dataTypeTest = false;
[3676] Fix | Delete
if (arrayTest) {
[3677] Fix | Delete
dataTypeTest =
[3678] Fix | Delete
input.filter(function (item) {
[3679] Fix | Delete
return !isNumber(item) && isString(input);
[3680] Fix | Delete
}).length === 0;
[3681] Fix | Delete
}
[3682] Fix | Delete
return arrayTest && dataTypeTest;
[3683] Fix | Delete
}
[3684] Fix | Delete
[3685] Fix | Delete
function isCalendarSpec(input) {
[3686] Fix | Delete
var objectTest = isObject(input) && !isObjectEmpty(input),
[3687] Fix | Delete
propertyTest = false,
[3688] Fix | Delete
properties = [
[3689] Fix | Delete
'sameDay',
[3690] Fix | Delete
'nextDay',
[3691] Fix | Delete
'lastDay',
[3692] Fix | Delete
'nextWeek',
[3693] Fix | Delete
'lastWeek',
[3694] Fix | Delete
'sameElse',
[3695] Fix | Delete
],
[3696] Fix | Delete
i,
[3697] Fix | Delete
property;
[3698] Fix | Delete
[3699] Fix | Delete
for (i = 0; i < properties.length; i += 1) {
[3700] Fix | Delete
property = properties[i];
[3701] Fix | Delete
propertyTest = propertyTest || hasOwnProp(input, property);
[3702] Fix | Delete
}
[3703] Fix | Delete
[3704] Fix | Delete
return objectTest && propertyTest;
[3705] Fix | Delete
}
[3706] Fix | Delete
[3707] Fix | Delete
function getCalendarFormat(myMoment, now) {
[3708] Fix | Delete
var diff = myMoment.diff(now, 'days', true);
[3709] Fix | Delete
return diff < -6
[3710] Fix | Delete
? 'sameElse'
[3711] Fix | Delete
: diff < -1
[3712] Fix | Delete
? 'lastWeek'
[3713] Fix | Delete
: diff < 0
[3714] Fix | Delete
? 'lastDay'
[3715] Fix | Delete
: diff < 1
[3716] Fix | Delete
? 'sameDay'
[3717] Fix | Delete
: diff < 2
[3718] Fix | Delete
? 'nextDay'
[3719] Fix | Delete
: diff < 7
[3720] Fix | Delete
? 'nextWeek'
[3721] Fix | Delete
: 'sameElse';
[3722] Fix | Delete
}
[3723] Fix | Delete
[3724] Fix | Delete
function calendar$1(time, formats) {
[3725] Fix | Delete
// Support for single parameter, formats only overload to the calendar function
[3726] Fix | Delete
if (arguments.length === 1) {
[3727] Fix | Delete
if (isMomentInput(arguments[0])) {
[3728] Fix | Delete
time = arguments[0];
[3729] Fix | Delete
formats = undefined;
[3730] Fix | Delete
} else if (isCalendarSpec(arguments[0])) {
[3731] Fix | Delete
formats = arguments[0];
[3732] Fix | Delete
time = undefined;
[3733] Fix | Delete
}
[3734] Fix | Delete
}
[3735] Fix | Delete
// We want to compare the start of today, vs this.
[3736] Fix | Delete
// Getting start-of-today depends on whether we're local/utc/offset or not.
[3737] Fix | Delete
var now = time || createLocal(),
[3738] Fix | Delete
sod = cloneWithOffset(now, this).startOf('day'),
[3739] Fix | Delete
format = hooks.calendarFormat(this, sod) || 'sameElse',
[3740] Fix | Delete
output =
[3741] Fix | Delete
formats &&
[3742] Fix | Delete
(isFunction(formats[format])
[3743] Fix | Delete
? formats[format].call(this, now)
[3744] Fix | Delete
: formats[format]);
[3745] Fix | Delete
[3746] Fix | Delete
return this.format(
[3747] Fix | Delete
output || this.localeData().calendar(format, this, createLocal(now))
[3748] Fix | Delete
);
[3749] Fix | Delete
}
[3750] Fix | Delete
[3751] Fix | Delete
function clone() {
[3752] Fix | Delete
return new Moment(this);
[3753] Fix | Delete
}
[3754] Fix | Delete
[3755] Fix | Delete
function isAfter(input, units) {
[3756] Fix | Delete
var localInput = isMoment(input) ? input : createLocal(input);
[3757] Fix | Delete
if (!(this.isValid() && localInput.isValid())) {
[3758] Fix | Delete
return false;
[3759] Fix | Delete
}
[3760] Fix | Delete
units = normalizeUnits(units) || 'millisecond';
[3761] Fix | Delete
if (units === 'millisecond') {
[3762] Fix | Delete
return this.valueOf() > localInput.valueOf();
[3763] Fix | Delete
} else {
[3764] Fix | Delete
return localInput.valueOf() < this.clone().startOf(units).valueOf();
[3765] Fix | Delete
}
[3766] Fix | Delete
}
[3767] Fix | Delete
[3768] Fix | Delete
function isBefore(input, units) {
[3769] Fix | Delete
var localInput = isMoment(input) ? input : createLocal(input);
[3770] Fix | Delete
if (!(this.isValid() && localInput.isValid())) {
[3771] Fix | Delete
return false;
[3772] Fix | Delete
}
[3773] Fix | Delete
units = normalizeUnits(units) || 'millisecond';
[3774] Fix | Delete
if (units === 'millisecond') {
[3775] Fix | Delete
return this.valueOf() < localInput.valueOf();
[3776] Fix | Delete
} else {
[3777] Fix | Delete
return this.clone().endOf(units).valueOf() < localInput.valueOf();
[3778] Fix | Delete
}
[3779] Fix | Delete
}
[3780] Fix | Delete
[3781] Fix | Delete
function isBetween(from, to, units, inclusivity) {
[3782] Fix | Delete
var localFrom = isMoment(from) ? from : createLocal(from),
[3783] Fix | Delete
localTo = isMoment(to) ? to : createLocal(to);
[3784] Fix | Delete
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
[3785] Fix | Delete
return false;
[3786] Fix | Delete
}
[3787] Fix | Delete
inclusivity = inclusivity || '()';
[3788] Fix | Delete
return (
[3789] Fix | Delete
(inclusivity[0] === '('
[3790] Fix | Delete
? this.isAfter(localFrom, units)
[3791] Fix | Delete
: !this.isBefore(localFrom, units)) &&
[3792] Fix | Delete
(inclusivity[1] === ')'
[3793] Fix | Delete
? this.isBefore(localTo, units)
[3794] Fix | Delete
: !this.isAfter(localTo, units))
[3795] Fix | Delete
);
[3796] Fix | Delete
}
[3797] Fix | Delete
[3798] Fix | Delete
function isSame(input, units) {
[3799] Fix | Delete
var localInput = isMoment(input) ? input : createLocal(input),
[3800] Fix | Delete
inputMs;
[3801] Fix | Delete
if (!(this.isValid() && localInput.isValid())) {
[3802] Fix | Delete
return false;
[3803] Fix | Delete
}
[3804] Fix | Delete
units = normalizeUnits(units) || 'millisecond';
[3805] Fix | Delete
if (units === 'millisecond') {
[3806] Fix | Delete
return this.valueOf() === localInput.valueOf();
[3807] Fix | Delete
} else {
[3808] Fix | Delete
inputMs = localInput.valueOf();
[3809] Fix | Delete
return (
[3810] Fix | Delete
this.clone().startOf(units).valueOf() <= inputMs &&
[3811] Fix | Delete
inputMs <= this.clone().endOf(units).valueOf()
[3812] Fix | Delete
);
[3813] Fix | Delete
}
[3814] Fix | Delete
}
[3815] Fix | Delete
[3816] Fix | Delete
function isSameOrAfter(input, units) {
[3817] Fix | Delete
return this.isSame(input, units) || this.isAfter(input, units);
[3818] Fix | Delete
}
[3819] Fix | Delete
[3820] Fix | Delete
function isSameOrBefore(input, units) {
[3821] Fix | Delete
return this.isSame(input, units) || this.isBefore(input, units);
[3822] Fix | Delete
}
[3823] Fix | Delete
[3824] Fix | Delete
function diff(input, units, asFloat) {
[3825] Fix | Delete
var that, zoneDelta, output;
[3826] Fix | Delete
[3827] Fix | Delete
if (!this.isValid()) {
[3828] Fix | Delete
return NaN;
[3829] Fix | Delete
}
[3830] Fix | Delete
[3831] Fix | Delete
that = cloneWithOffset(input, this);
[3832] Fix | Delete
[3833] Fix | Delete
if (!that.isValid()) {
[3834] Fix | Delete
return NaN;
[3835] Fix | Delete
}
[3836] Fix | Delete
[3837] Fix | Delete
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
[3838] Fix | Delete
[3839] Fix | Delete
units = normalizeUnits(units);
[3840] Fix | Delete
[3841] Fix | Delete
switch (units) {
[3842] Fix | Delete
case 'year':
[3843] Fix | Delete
output = monthDiff(this, that) / 12;
[3844] Fix | Delete
break;
[3845] Fix | Delete
case 'month':
[3846] Fix | Delete
output = monthDiff(this, that);
[3847] Fix | Delete
break;
[3848] Fix | Delete
case 'quarter':
[3849] Fix | Delete
output = monthDiff(this, that) / 3;
[3850] Fix | Delete
break;
[3851] Fix | Delete
case 'second':
[3852] Fix | Delete
output = (this - that) / 1e3;
[3853] Fix | Delete
break; // 1000
[3854] Fix | Delete
case 'minute':
[3855] Fix | Delete
output = (this - that) / 6e4;
[3856] Fix | Delete
break; // 1000 * 60
[3857] Fix | Delete
case 'hour':
[3858] Fix | Delete
output = (this - that) / 36e5;
[3859] Fix | Delete
break; // 1000 * 60 * 60
[3860] Fix | Delete
case 'day':
[3861] Fix | Delete
output = (this - that - zoneDelta) / 864e5;
[3862] Fix | Delete
break; // 1000 * 60 * 60 * 24, negate dst
[3863] Fix | Delete
case 'week':
[3864] Fix | Delete
output = (this - that - zoneDelta) / 6048e5;
[3865] Fix | Delete
break; // 1000 * 60 * 60 * 24 * 7, negate dst
[3866] Fix | Delete
default:
[3867] Fix | Delete
output = this - that;
[3868] Fix | Delete
}
[3869] Fix | Delete
[3870] Fix | Delete
return asFloat ? output : absFloor(output);
[3871] Fix | Delete
}
[3872] Fix | Delete
[3873] Fix | Delete
function monthDiff(a, b) {
[3874] Fix | Delete
if (a.date() < b.date()) {
[3875] Fix | Delete
// end-of-month calculations work correct when the start month has more
[3876] Fix | Delete
// days than the end month.
[3877] Fix | Delete
return -monthDiff(b, a);
[3878] Fix | Delete
}
[3879] Fix | Delete
// difference in months
[3880] Fix | Delete
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
[3881] Fix | Delete
// b is in (anchor - 1 month, anchor + 1 month)
[3882] Fix | Delete
anchor = a.clone().add(wholeMonthDiff, 'months'),
[3883] Fix | Delete
anchor2,
[3884] Fix | Delete
adjust;
[3885] Fix | Delete
[3886] Fix | Delete
if (b - anchor < 0) {
[3887] Fix | Delete
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
[3888] Fix | Delete
// linear across the month
[3889] Fix | Delete
adjust = (b - anchor) / (anchor - anchor2);
[3890] Fix | Delete
} else {
[3891] Fix | Delete
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
[3892] Fix | Delete
// linear across the month
[3893] Fix | Delete
adjust = (b - anchor) / (anchor2 - anchor);
[3894] Fix | Delete
}
[3895] Fix | Delete
[3896] Fix | Delete
//check for negative zero, return zero if negative zero
[3897] Fix | Delete
return -(wholeMonthDiff + adjust) || 0;
[3898] Fix | Delete
}
[3899] Fix | Delete
[3900] Fix | Delete
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
[3901] Fix | Delete
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
[3902] Fix | Delete
[3903] Fix | Delete
function toString() {
[3904] Fix | Delete
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
[3905] Fix | Delete
}
[3906] Fix | Delete
[3907] Fix | Delete
function toISOString(keepOffset) {
[3908] Fix | Delete
if (!this.isValid()) {
[3909] Fix | Delete
return null;
[3910] Fix | Delete
}
[3911] Fix | Delete
var utc = keepOffset !== true,
[3912] Fix | Delete
m = utc ? this.clone().utc() : this;
[3913] Fix | Delete
if (m.year() < 0 || m.year() > 9999) {
[3914] Fix | Delete
return formatMoment(
[3915] Fix | Delete
m,
[3916] Fix | Delete
utc
[3917] Fix | Delete
? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
[3918] Fix | Delete
: 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
[3919] Fix | Delete
);
[3920] Fix | Delete
}
[3921] Fix | Delete
if (isFunction(Date.prototype.toISOString)) {
[3922] Fix | Delete
// native implementation is ~50x faster, use it when we can
[3923] Fix | Delete
if (utc) {
[3924] Fix | Delete
return this.toDate().toISOString();
[3925] Fix | Delete
} else {
[3926] Fix | Delete
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
[3927] Fix | Delete
.toISOString()
[3928] Fix | Delete
.replace('Z', formatMoment(m, 'Z'));
[3929] Fix | Delete
}
[3930] Fix | Delete
}
[3931] Fix | Delete
return formatMoment(
[3932] Fix | Delete
m,
[3933] Fix | Delete
utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
[3934] Fix | Delete
);
[3935] Fix | Delete
}
[3936] Fix | Delete
[3937] Fix | Delete
/**
[3938] Fix | Delete
* Return a human readable representation of a moment that can
[3939] Fix | Delete
* also be evaluated to get a new moment which is the same
[3940] Fix | Delete
*
[3941] Fix | Delete
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
[3942] Fix | Delete
*/
[3943] Fix | Delete
function inspect() {
[3944] Fix | Delete
if (!this.isValid()) {
[3945] Fix | Delete
return 'moment.invalid(/* ' + this._i + ' */)';
[3946] Fix | Delete
}
[3947] Fix | Delete
var func = 'moment',
[3948] Fix | Delete
zone = '',
[3949] Fix | Delete
prefix,
[3950] Fix | Delete
year,
[3951] Fix | Delete
datetime,
[3952] Fix | Delete
suffix;
[3953] Fix | Delete
if (!this.isLocal()) {
[3954] Fix | Delete
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
[3955] Fix | Delete
zone = 'Z';
[3956] Fix | Delete
}
[3957] Fix | Delete
prefix = '[' + func + '("]';
[3958] Fix | Delete
year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
[3959] Fix | Delete
datetime = '-MM-DD[T]HH:mm:ss.SSS';
[3960] Fix | Delete
suffix = zone + '[")]';
[3961] Fix | Delete
[3962] Fix | Delete
return this.format(prefix + year + datetime + suffix);
[3963] Fix | Delete
}
[3964] Fix | Delete
[3965] Fix | Delete
function format(inputString) {
[3966] Fix | Delete
if (!inputString) {
[3967] Fix | Delete
inputString = this.isUtc()
[3968] Fix | Delete
? hooks.defaultFormatUtc
[3969] Fix | Delete
: hooks.defaultFormat;
[3970] Fix | Delete
}
[3971] Fix | Delete
var output = formatMoment(this, inputString);
[3972] Fix | Delete
return this.localeData().postformat(output);
[3973] Fix | Delete
}
[3974] Fix | Delete
[3975] Fix | Delete
function from(time, withoutSuffix) {
[3976] Fix | Delete
if (
[3977] Fix | Delete
this.isValid() &&
[3978] Fix | Delete
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
[3979] Fix | Delete
) {
[3980] Fix | Delete
return createDuration({ to: this, from: time })
[3981] Fix | Delete
.locale(this.locale())
[3982] Fix | Delete
.humanize(!withoutSuffix);
[3983] Fix | Delete
} else {
[3984] Fix | Delete
return this.localeData().invalidDate();
[3985] Fix | Delete
}
[3986] Fix | Delete
}
[3987] Fix | Delete
[3988] Fix | Delete
function fromNow(withoutSuffix) {
[3989] Fix | Delete
return this.from(createLocal(), withoutSuffix);
[3990] Fix | Delete
}
[3991] Fix | Delete
[3992] Fix | Delete
function to(time, withoutSuffix) {
[3993] Fix | Delete
if (
[3994] Fix | Delete
this.isValid() &&
[3995] Fix | Delete
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
[3996] Fix | Delete
) {
[3997] Fix | Delete
return createDuration({ from: this, to: time })
[3998] Fix | Delete
.locale(this.locale())
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function