m.add = function(n, o) {
var u, d = this;
n = Number(n);
var f = T.p(o)
, p = function(e) {
var t = E(d);
return T.w(t.date(t.date() + Math.round(e * n)), d)
};
if (f === l)
return this.set(l, this.$M + n);
if (f === h)
return this.set(h, this.$y + n);
if (f === a)
return p(1);
if (f === c)
return p(7);
var g = (u = {},
u[r] = e,
u[s] = t,
u[i] = 1e3,
u)[f] || 1
, m = this.$d.getTime() + n * g;
return T.w(m, this)
}
,
m.subtract = function(e, t) {
return this.add(-1 * e, t)
}
,
m.format = function(e) {
var t = this
, n = this.$locale();
if (!this.isValid())
return n.invalidDate || f;
var i = e || "YYYY-MM-DDTHH:mm:ssZ"
, r = T.z(this)
, s = this.$H
, o = this.$m
, a = this.$M
, c = n.weekdays
, l = n.months
, u = n.meridiem
, h = function(e, n, r, s) {
return e && (e[n] || e(t, i)) || r[n].slice(0, s)
}
, d = function(e) {
return T.s(s % 12 || 12, e, "0")
}
, p = u || function(e, t, n) {
var i = e < 12 ? "AM" : "PM";
return n ? i.toLowerCase() : i
}
;
return i.replace(g, (function(e, i) {
return i || function(e) {
switch (e) {
case "YY":
return String(t.$y).slice(-2);
case "YYYY":
return T.s(t.$y, 4, "0");
case "M":
return a + 1;
case "MM":
return T.s(a + 1, 2, "0");
case "MMM":
return h(n.monthsShort, a, l, 3);
case "MMMM":
return h(l, a);
case "D":
return t.$D;
case "DD":
return T.s(t.$D, 2, "0");
case "d":
return String(t.$W);
case "dd":
return h(n.weekdaysMin, t.$W, c, 2);
case "ddd":
return h(n.weekdaysShort, t.$W, c, 3);
case "dddd":
return c[t.$W];
case "H":
return String(s);
case "HH":
return T.s(s, 2, "0");
case "h":
return d(1);
case "hh":
return d(2);
case "a":
return p(s, o, !0);
case "A":
return p(s, o, !1);
case "m":
return String(o);
case "mm":
return T.s(o, 2, "0");
case "s":
return String(t.$s);
case "ss":
return T.s(t.$s, 2, "0");
case "SSS":
return T.s(t.$ms, 3, "0");
case "Z":
return r
}
return null
}(e) || r.replace(":", "")
}
))
}
,
m.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
}
,
m.diff = function(n, o, d) {
var f, p = this, g = T.p(o), m = E(n), y = (m.utcOffset() - this.utcOffset()) * e, v = this - m, b = function() {
return T.m(p, m)
};
switch (g) {
case h:
f = b() / 12;
break;
case l:
f = b();
break;
case u:
f = b() / 3;
break;
case c:
f = (v - y) / 6048e5;
break;
case a:
f = (v - y) / 864e5;
break;
case s:
f = v / t;
break;
case r:
f = v / e;
break;
case i:
f = v / 1e3;
break;
default:
f = v
}
return d ? f : T.a(f)
}
,
m.daysInMonth = function() {
return this.endOf(l).$D
}
,
m.$locale = function() {
return w[this.$L]
}
,
m.locale = function(e, t) {
if (!e)
|