first commit
This commit is contained in:
55
public/bower_components/moment/src/lib/moment/add-subtract.js
vendored
Executable file
55
public/bower_components/moment/src/lib/moment/add-subtract.js
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
import { get, set } from './get-set';
|
||||
import { setMonth } from '../units/month';
|
||||
import { createDuration } from '../duration/create';
|
||||
import { deprecateSimple } from '../utils/deprecate';
|
||||
import { hooks } from '../utils/hooks';
|
||||
import absRound from '../utils/abs-round';
|
||||
|
||||
|
||||
// TODO: remove 'name' arg after deprecation is removed
|
||||
function createAdder(direction, name) {
|
||||
return function (val, period) {
|
||||
var dur, tmp;
|
||||
//invert the arguments, but complain about it
|
||||
if (period !== null && !isNaN(+period)) {
|
||||
deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
|
||||
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
|
||||
tmp = val; val = period; period = tmp;
|
||||
}
|
||||
|
||||
val = typeof val === 'string' ? +val : val;
|
||||
dur = createDuration(val, period);
|
||||
addSubtract(this, dur, direction);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
export function addSubtract (mom, duration, isAdding, updateOffset) {
|
||||
var milliseconds = duration._milliseconds,
|
||||
days = absRound(duration._days),
|
||||
months = absRound(duration._months);
|
||||
|
||||
if (!mom.isValid()) {
|
||||
// No op
|
||||
return;
|
||||
}
|
||||
|
||||
updateOffset = updateOffset == null ? true : updateOffset;
|
||||
|
||||
if (milliseconds) {
|
||||
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
|
||||
}
|
||||
if (days) {
|
||||
set(mom, 'Date', get(mom, 'Date') + days * isAdding);
|
||||
}
|
||||
if (months) {
|
||||
setMonth(mom, get(mom, 'Month') + months * isAdding);
|
||||
}
|
||||
if (updateOffset) {
|
||||
hooks.updateOffset(mom, days || months);
|
||||
}
|
||||
}
|
||||
|
||||
export var add = createAdder(1, 'add');
|
||||
export var subtract = createAdder(-1, 'subtract');
|
||||
|
||||
26
public/bower_components/moment/src/lib/moment/calendar.js
vendored
Executable file
26
public/bower_components/moment/src/lib/moment/calendar.js
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
import { createLocal } from '../create/local';
|
||||
import { cloneWithOffset } from '../units/offset';
|
||||
import isFunction from '../utils/is-function';
|
||||
import { hooks } from '../utils/hooks';
|
||||
|
||||
export function getCalendarFormat(myMoment, now) {
|
||||
var diff = myMoment.diff(now, 'days', true);
|
||||
return diff < -6 ? 'sameElse' :
|
||||
diff < -1 ? 'lastWeek' :
|
||||
diff < 0 ? 'lastDay' :
|
||||
diff < 1 ? 'sameDay' :
|
||||
diff < 2 ? 'nextDay' :
|
||||
diff < 7 ? 'nextWeek' : 'sameElse';
|
||||
}
|
||||
|
||||
export function calendar (time, formats) {
|
||||
// We want to compare the start of today, vs this.
|
||||
// Getting start-of-today depends on whether we're local/utc/offset or not.
|
||||
var now = time || createLocal(),
|
||||
sod = cloneWithOffset(now, this).startOf('day'),
|
||||
format = hooks.calendarFormat(this, sod) || 'sameElse';
|
||||
|
||||
var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
|
||||
|
||||
return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
|
||||
}
|
||||
5
public/bower_components/moment/src/lib/moment/clone.js
vendored
Executable file
5
public/bower_components/moment/src/lib/moment/clone.js
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import { Moment } from './constructor';
|
||||
|
||||
export function clone () {
|
||||
return new Moment(this);
|
||||
}
|
||||
59
public/bower_components/moment/src/lib/moment/compare.js
vendored
Executable file
59
public/bower_components/moment/src/lib/moment/compare.js
vendored
Executable file
@@ -0,0 +1,59 @@
|
||||
import { isMoment } from './constructor';
|
||||
import { normalizeUnits } from '../units/aliases';
|
||||
import { createLocal } from '../create/local';
|
||||
import isUndefined from '../utils/is-undefined';
|
||||
|
||||
export function isAfter (input, units) {
|
||||
var localInput = isMoment(input) ? input : createLocal(input);
|
||||
if (!(this.isValid() && localInput.isValid())) {
|
||||
return false;
|
||||
}
|
||||
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
|
||||
if (units === 'millisecond') {
|
||||
return this.valueOf() > localInput.valueOf();
|
||||
} else {
|
||||
return localInput.valueOf() < this.clone().startOf(units).valueOf();
|
||||
}
|
||||
}
|
||||
|
||||
export function isBefore (input, units) {
|
||||
var localInput = isMoment(input) ? input : createLocal(input);
|
||||
if (!(this.isValid() && localInput.isValid())) {
|
||||
return false;
|
||||
}
|
||||
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
|
||||
if (units === 'millisecond') {
|
||||
return this.valueOf() < localInput.valueOf();
|
||||
} else {
|
||||
return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
||||
}
|
||||
}
|
||||
|
||||
export function isBetween (from, to, units, inclusivity) {
|
||||
inclusivity = inclusivity || '()';
|
||||
return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
|
||||
(inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
|
||||
}
|
||||
|
||||
export function isSame (input, units) {
|
||||
var localInput = isMoment(input) ? input : createLocal(input),
|
||||
inputMs;
|
||||
if (!(this.isValid() && localInput.isValid())) {
|
||||
return false;
|
||||
}
|
||||
units = normalizeUnits(units || 'millisecond');
|
||||
if (units === 'millisecond') {
|
||||
return this.valueOf() === localInput.valueOf();
|
||||
} else {
|
||||
inputMs = localInput.valueOf();
|
||||
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
|
||||
}
|
||||
}
|
||||
|
||||
export function isSameOrAfter (input, units) {
|
||||
return this.isSame(input, units) || this.isAfter(input,units);
|
||||
}
|
||||
|
||||
export function isSameOrBefore (input, units) {
|
||||
return this.isSame(input, units) || this.isBefore(input,units);
|
||||
}
|
||||
74
public/bower_components/moment/src/lib/moment/constructor.js
vendored
Executable file
74
public/bower_components/moment/src/lib/moment/constructor.js
vendored
Executable file
@@ -0,0 +1,74 @@
|
||||
import { hooks } from '../utils/hooks';
|
||||
import hasOwnProp from '../utils/has-own-prop';
|
||||
import isUndefined from '../utils/is-undefined';
|
||||
import getParsingFlags from '../create/parsing-flags';
|
||||
|
||||
// Plugins that add properties should also add the key here (null value),
|
||||
// so we can properly clone ourselves.
|
||||
var momentProperties = hooks.momentProperties = [];
|
||||
|
||||
export function copyConfig(to, from) {
|
||||
var i, prop, val;
|
||||
|
||||
if (!isUndefined(from._isAMomentObject)) {
|
||||
to._isAMomentObject = from._isAMomentObject;
|
||||
}
|
||||
if (!isUndefined(from._i)) {
|
||||
to._i = from._i;
|
||||
}
|
||||
if (!isUndefined(from._f)) {
|
||||
to._f = from._f;
|
||||
}
|
||||
if (!isUndefined(from._l)) {
|
||||
to._l = from._l;
|
||||
}
|
||||
if (!isUndefined(from._strict)) {
|
||||
to._strict = from._strict;
|
||||
}
|
||||
if (!isUndefined(from._tzm)) {
|
||||
to._tzm = from._tzm;
|
||||
}
|
||||
if (!isUndefined(from._isUTC)) {
|
||||
to._isUTC = from._isUTC;
|
||||
}
|
||||
if (!isUndefined(from._offset)) {
|
||||
to._offset = from._offset;
|
||||
}
|
||||
if (!isUndefined(from._pf)) {
|
||||
to._pf = getParsingFlags(from);
|
||||
}
|
||||
if (!isUndefined(from._locale)) {
|
||||
to._locale = from._locale;
|
||||
}
|
||||
|
||||
if (momentProperties.length > 0) {
|
||||
for (i in momentProperties) {
|
||||
prop = momentProperties[i];
|
||||
val = from[prop];
|
||||
if (!isUndefined(val)) {
|
||||
to[prop] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
var updateInProgress = false;
|
||||
|
||||
// Moment prototype object
|
||||
export function Moment(config) {
|
||||
copyConfig(this, config);
|
||||
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
|
||||
// Prevent infinite loop in case updateOffset creates new moment
|
||||
// objects.
|
||||
if (updateInProgress === false) {
|
||||
updateInProgress = true;
|
||||
hooks.updateOffset(this);
|
||||
updateInProgress = false;
|
||||
}
|
||||
}
|
||||
|
||||
export function isMoment (obj) {
|
||||
return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
|
||||
}
|
||||
9
public/bower_components/moment/src/lib/moment/creation-data.js
vendored
Executable file
9
public/bower_components/moment/src/lib/moment/creation-data.js
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
export function creationData() {
|
||||
return {
|
||||
input: this._i,
|
||||
format: this._f,
|
||||
locale: this._locale,
|
||||
isUTC: this._isUTC,
|
||||
strict: this._strict
|
||||
};
|
||||
}
|
||||
62
public/bower_components/moment/src/lib/moment/diff.js
vendored
Executable file
62
public/bower_components/moment/src/lib/moment/diff.js
vendored
Executable file
@@ -0,0 +1,62 @@
|
||||
import absFloor from '../utils/abs-floor';
|
||||
import { cloneWithOffset } from '../units/offset';
|
||||
import { normalizeUnits } from '../units/aliases';
|
||||
|
||||
export function diff (input, units, asFloat) {
|
||||
var that,
|
||||
zoneDelta,
|
||||
delta, output;
|
||||
|
||||
if (!this.isValid()) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
that = cloneWithOffset(input, this);
|
||||
|
||||
if (!that.isValid()) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
|
||||
|
||||
units = normalizeUnits(units);
|
||||
|
||||
if (units === 'year' || units === 'month' || units === 'quarter') {
|
||||
output = monthDiff(this, that);
|
||||
if (units === 'quarter') {
|
||||
output = output / 3;
|
||||
} else if (units === 'year') {
|
||||
output = output / 12;
|
||||
}
|
||||
} else {
|
||||
delta = this - that;
|
||||
output = units === 'second' ? delta / 1e3 : // 1000
|
||||
units === 'minute' ? delta / 6e4 : // 1000 * 60
|
||||
units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
|
||||
units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
|
||||
units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
|
||||
delta;
|
||||
}
|
||||
return asFloat ? output : absFloor(output);
|
||||
}
|
||||
|
||||
function monthDiff (a, b) {
|
||||
// difference in months
|
||||
var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
|
||||
// b is in (anchor - 1 month, anchor + 1 month)
|
||||
anchor = a.clone().add(wholeMonthDiff, 'months'),
|
||||
anchor2, adjust;
|
||||
|
||||
if (b - anchor < 0) {
|
||||
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
|
||||
// linear across the month
|
||||
adjust = (b - anchor) / (anchor - anchor2);
|
||||
} else {
|
||||
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
|
||||
// linear across the month
|
||||
adjust = (b - anchor) / (anchor2 - anchor);
|
||||
}
|
||||
|
||||
//check for negative zero, return zero if negative zero
|
||||
return -(wholeMonthDiff + adjust) || 0;
|
||||
}
|
||||
32
public/bower_components/moment/src/lib/moment/format.js
vendored
Executable file
32
public/bower_components/moment/src/lib/moment/format.js
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
import { formatMoment } from '../format/format';
|
||||
import { hooks } from '../utils/hooks';
|
||||
import isFunction from '../utils/is-function';
|
||||
|
||||
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
||||
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
|
||||
|
||||
export function toString () {
|
||||
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
|
||||
}
|
||||
|
||||
export function toISOString () {
|
||||
var m = this.clone().utc();
|
||||
if (0 < m.year() && m.year() <= 9999) {
|
||||
if (isFunction(Date.prototype.toISOString)) {
|
||||
// native implementation is ~50x faster, use it when we can
|
||||
return this.toDate().toISOString();
|
||||
} else {
|
||||
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
|
||||
}
|
||||
} else {
|
||||
return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
|
||||
}
|
||||
}
|
||||
|
||||
export function format (inputString) {
|
||||
if (!inputString) {
|
||||
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
|
||||
}
|
||||
var output = formatMoment(this, inputString);
|
||||
return this.localeData().postformat(output);
|
||||
}
|
||||
17
public/bower_components/moment/src/lib/moment/from.js
vendored
Executable file
17
public/bower_components/moment/src/lib/moment/from.js
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
import { createDuration } from '../duration/create';
|
||||
import { createLocal } from '../create/local';
|
||||
import { isMoment } from '../moment/constructor';
|
||||
|
||||
export function from (time, withoutSuffix) {
|
||||
if (this.isValid() &&
|
||||
((isMoment(time) && time.isValid()) ||
|
||||
createLocal(time).isValid())) {
|
||||
return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
|
||||
} else {
|
||||
return this.localeData().invalidDate();
|
||||
}
|
||||
}
|
||||
|
||||
export function fromNow (withoutSuffix) {
|
||||
return this.from(createLocal(), withoutSuffix);
|
||||
}
|
||||
55
public/bower_components/moment/src/lib/moment/get-set.js
vendored
Executable file
55
public/bower_components/moment/src/lib/moment/get-set.js
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
import { normalizeUnits, normalizeObjectUnits } from '../units/aliases';
|
||||
import { getPrioritizedUnits } from '../units/priorities';
|
||||
import { hooks } from '../utils/hooks';
|
||||
import isFunction from '../utils/is-function';
|
||||
|
||||
|
||||
export function makeGetSet (unit, keepTime) {
|
||||
return function (value) {
|
||||
if (value != null) {
|
||||
set(this, unit, value);
|
||||
hooks.updateOffset(this, keepTime);
|
||||
return this;
|
||||
} else {
|
||||
return get(this, unit);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function get (mom, unit) {
|
||||
return mom.isValid() ?
|
||||
mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
|
||||
}
|
||||
|
||||
export function set (mom, unit, value) {
|
||||
if (mom.isValid()) {
|
||||
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
||||
}
|
||||
}
|
||||
|
||||
// MOMENTS
|
||||
|
||||
export function stringGet (units) {
|
||||
units = normalizeUnits(units);
|
||||
if (isFunction(this[units])) {
|
||||
return this[units]();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
export function stringSet (units, value) {
|
||||
if (typeof units === 'object') {
|
||||
units = normalizeObjectUnits(units);
|
||||
var prioritized = getPrioritizedUnits(units);
|
||||
for (var i = 0; i < prioritized.length; i++) {
|
||||
this[prioritized[i].unit](units[prioritized[i].unit]);
|
||||
}
|
||||
} else {
|
||||
units = normalizeUnits(units);
|
||||
if (isFunction(this[units])) {
|
||||
return this[units](value);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
34
public/bower_components/moment/src/lib/moment/locale.js
vendored
Executable file
34
public/bower_components/moment/src/lib/moment/locale.js
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
import { getLocale } from '../locale/locales';
|
||||
import { deprecate } from '../utils/deprecate';
|
||||
|
||||
// If passed a locale key, it will set the locale for this
|
||||
// instance. Otherwise, it will return the locale configuration
|
||||
// variables for this instance.
|
||||
export function locale (key) {
|
||||
var newLocaleData;
|
||||
|
||||
if (key === undefined) {
|
||||
return this._locale._abbr;
|
||||
} else {
|
||||
newLocaleData = getLocale(key);
|
||||
if (newLocaleData != null) {
|
||||
this._locale = newLocaleData;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
export var lang = deprecate(
|
||||
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
|
||||
function (key) {
|
||||
if (key === undefined) {
|
||||
return this.localeData();
|
||||
} else {
|
||||
return this.locale(key);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
export function localeData () {
|
||||
return this._locale;
|
||||
}
|
||||
63
public/bower_components/moment/src/lib/moment/min-max.js
vendored
Executable file
63
public/bower_components/moment/src/lib/moment/min-max.js
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
import { deprecate } from '../utils/deprecate';
|
||||
import isArray from '../utils/is-array';
|
||||
import { createLocal } from '../create/local';
|
||||
import { createInvalid } from '../create/valid';
|
||||
|
||||
export var prototypeMin = deprecate(
|
||||
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
|
||||
function () {
|
||||
var other = createLocal.apply(null, arguments);
|
||||
if (this.isValid() && other.isValid()) {
|
||||
return other < this ? this : other;
|
||||
} else {
|
||||
return createInvalid();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
export var prototypeMax = deprecate(
|
||||
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
|
||||
function () {
|
||||
var other = createLocal.apply(null, arguments);
|
||||
if (this.isValid() && other.isValid()) {
|
||||
return other > this ? this : other;
|
||||
} else {
|
||||
return createInvalid();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Pick a moment m from moments so that m[fn](other) is true for all
|
||||
// other. This relies on the function fn to be transitive.
|
||||
//
|
||||
// moments should either be an array of moment objects or an array, whose
|
||||
// first element is an array of moment objects.
|
||||
function pickBy(fn, moments) {
|
||||
var res, i;
|
||||
if (moments.length === 1 && isArray(moments[0])) {
|
||||
moments = moments[0];
|
||||
}
|
||||
if (!moments.length) {
|
||||
return createLocal();
|
||||
}
|
||||
res = moments[0];
|
||||
for (i = 1; i < moments.length; ++i) {
|
||||
if (!moments[i].isValid() || moments[i][fn](res)) {
|
||||
res = moments[i];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// TODO: Use [].sort instead?
|
||||
export function min () {
|
||||
var args = [].slice.call(arguments, 0);
|
||||
|
||||
return pickBy('isBefore', args);
|
||||
}
|
||||
|
||||
export function max () {
|
||||
var args = [].slice.call(arguments, 0);
|
||||
|
||||
return pickBy('isAfter', args);
|
||||
}
|
||||
28
public/bower_components/moment/src/lib/moment/moment.js
vendored
Executable file
28
public/bower_components/moment/src/lib/moment/moment.js
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
import { createLocal } from '../create/local';
|
||||
import { createUTC } from '../create/utc';
|
||||
import { createInvalid } from '../create/valid';
|
||||
import { isMoment } from './constructor';
|
||||
import { min, max } from './min-max';
|
||||
import { now } from './now';
|
||||
import momentPrototype from './prototype';
|
||||
|
||||
function createUnix (input) {
|
||||
return createLocal(input * 1000);
|
||||
}
|
||||
|
||||
function createInZone () {
|
||||
return createLocal.apply(null, arguments).parseZone();
|
||||
}
|
||||
|
||||
export {
|
||||
now,
|
||||
min,
|
||||
max,
|
||||
isMoment,
|
||||
createUTC,
|
||||
createUnix,
|
||||
createLocal,
|
||||
createInZone,
|
||||
createInvalid,
|
||||
momentPrototype
|
||||
};
|
||||
3
public/bower_components/moment/src/lib/moment/now.js
vendored
Executable file
3
public/bower_components/moment/src/lib/moment/now.js
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
export var now = function () {
|
||||
return Date.now ? Date.now() : +(new Date());
|
||||
};
|
||||
149
public/bower_components/moment/src/lib/moment/prototype.js
vendored
Executable file
149
public/bower_components/moment/src/lib/moment/prototype.js
vendored
Executable file
@@ -0,0 +1,149 @@
|
||||
import { Moment } from './constructor';
|
||||
|
||||
var proto = Moment.prototype;
|
||||
|
||||
import { add, subtract } from './add-subtract';
|
||||
import { calendar, getCalendarFormat } from './calendar';
|
||||
import { clone } from './clone';
|
||||
import { isBefore, isBetween, isSame, isAfter, isSameOrAfter, isSameOrBefore } from './compare';
|
||||
import { diff } from './diff';
|
||||
import { format, toString, toISOString } from './format';
|
||||
import { from, fromNow } from './from';
|
||||
import { to, toNow } from './to';
|
||||
import { stringGet, stringSet } from './get-set';
|
||||
import { locale, localeData, lang } from './locale';
|
||||
import { prototypeMin, prototypeMax } from './min-max';
|
||||
import { startOf, endOf } from './start-end-of';
|
||||
import { valueOf, toDate, toArray, toObject, toJSON, unix } from './to-type';
|
||||
import { isValid, parsingFlags, invalidAt } from './valid';
|
||||
import { creationData } from './creation-data';
|
||||
|
||||
proto.add = add;
|
||||
proto.calendar = calendar;
|
||||
proto.clone = clone;
|
||||
proto.diff = diff;
|
||||
proto.endOf = endOf;
|
||||
proto.format = format;
|
||||
proto.from = from;
|
||||
proto.fromNow = fromNow;
|
||||
proto.to = to;
|
||||
proto.toNow = toNow;
|
||||
proto.get = stringGet;
|
||||
proto.invalidAt = invalidAt;
|
||||
proto.isAfter = isAfter;
|
||||
proto.isBefore = isBefore;
|
||||
proto.isBetween = isBetween;
|
||||
proto.isSame = isSame;
|
||||
proto.isSameOrAfter = isSameOrAfter;
|
||||
proto.isSameOrBefore = isSameOrBefore;
|
||||
proto.isValid = isValid;
|
||||
proto.lang = lang;
|
||||
proto.locale = locale;
|
||||
proto.localeData = localeData;
|
||||
proto.max = prototypeMax;
|
||||
proto.min = prototypeMin;
|
||||
proto.parsingFlags = parsingFlags;
|
||||
proto.set = stringSet;
|
||||
proto.startOf = startOf;
|
||||
proto.subtract = subtract;
|
||||
proto.toArray = toArray;
|
||||
proto.toObject = toObject;
|
||||
proto.toDate = toDate;
|
||||
proto.toISOString = toISOString;
|
||||
proto.toJSON = toJSON;
|
||||
proto.toString = toString;
|
||||
proto.unix = unix;
|
||||
proto.valueOf = valueOf;
|
||||
proto.creationData = creationData;
|
||||
|
||||
// Year
|
||||
import { getSetYear, getIsLeapYear } from '../units/year';
|
||||
proto.year = getSetYear;
|
||||
proto.isLeapYear = getIsLeapYear;
|
||||
|
||||
// Week Year
|
||||
import { getSetWeekYear, getSetISOWeekYear, getWeeksInYear, getISOWeeksInYear } from '../units/week-year';
|
||||
proto.weekYear = getSetWeekYear;
|
||||
proto.isoWeekYear = getSetISOWeekYear;
|
||||
|
||||
// Quarter
|
||||
import { getSetQuarter } from '../units/quarter';
|
||||
proto.quarter = proto.quarters = getSetQuarter;
|
||||
|
||||
// Month
|
||||
import { getSetMonth, getDaysInMonth } from '../units/month';
|
||||
proto.month = getSetMonth;
|
||||
proto.daysInMonth = getDaysInMonth;
|
||||
|
||||
// Week
|
||||
import { getSetWeek, getSetISOWeek } from '../units/week';
|
||||
proto.week = proto.weeks = getSetWeek;
|
||||
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
||||
proto.weeksInYear = getWeeksInYear;
|
||||
proto.isoWeeksInYear = getISOWeeksInYear;
|
||||
|
||||
// Day
|
||||
import { getSetDayOfMonth } from '../units/day-of-month';
|
||||
import { getSetDayOfWeek, getSetISODayOfWeek, getSetLocaleDayOfWeek } from '../units/day-of-week';
|
||||
import { getSetDayOfYear } from '../units/day-of-year';
|
||||
proto.date = getSetDayOfMonth;
|
||||
proto.day = proto.days = getSetDayOfWeek;
|
||||
proto.weekday = getSetLocaleDayOfWeek;
|
||||
proto.isoWeekday = getSetISODayOfWeek;
|
||||
proto.dayOfYear = getSetDayOfYear;
|
||||
|
||||
// Hour
|
||||
import { getSetHour } from '../units/hour';
|
||||
proto.hour = proto.hours = getSetHour;
|
||||
|
||||
// Minute
|
||||
import { getSetMinute } from '../units/minute';
|
||||
proto.minute = proto.minutes = getSetMinute;
|
||||
|
||||
// Second
|
||||
import { getSetSecond } from '../units/second';
|
||||
proto.second = proto.seconds = getSetSecond;
|
||||
|
||||
// Millisecond
|
||||
import { getSetMillisecond } from '../units/millisecond';
|
||||
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
||||
|
||||
// Offset
|
||||
import {
|
||||
getSetOffset,
|
||||
setOffsetToUTC,
|
||||
setOffsetToLocal,
|
||||
setOffsetToParsedOffset,
|
||||
hasAlignedHourOffset,
|
||||
isDaylightSavingTime,
|
||||
isDaylightSavingTimeShifted,
|
||||
getSetZone,
|
||||
isLocal,
|
||||
isUtcOffset,
|
||||
isUtc
|
||||
} from '../units/offset';
|
||||
proto.utcOffset = getSetOffset;
|
||||
proto.utc = setOffsetToUTC;
|
||||
proto.local = setOffsetToLocal;
|
||||
proto.parseZone = setOffsetToParsedOffset;
|
||||
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
||||
proto.isDST = isDaylightSavingTime;
|
||||
proto.isLocal = isLocal;
|
||||
proto.isUtcOffset = isUtcOffset;
|
||||
proto.isUtc = isUtc;
|
||||
proto.isUTC = isUtc;
|
||||
|
||||
// Timezone
|
||||
import { getZoneAbbr, getZoneName } from '../units/timezone';
|
||||
proto.zoneAbbr = getZoneAbbr;
|
||||
proto.zoneName = getZoneName;
|
||||
|
||||
// Deprecations
|
||||
import { deprecate } from '../utils/deprecate';
|
||||
proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
|
||||
proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
|
||||
proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
|
||||
proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
|
||||
proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
|
||||
|
||||
export default proto;
|
||||
59
public/bower_components/moment/src/lib/moment/start-end-of.js
vendored
Executable file
59
public/bower_components/moment/src/lib/moment/start-end-of.js
vendored
Executable file
@@ -0,0 +1,59 @@
|
||||
import { normalizeUnits } from '../units/aliases';
|
||||
|
||||
export function startOf (units) {
|
||||
units = normalizeUnits(units);
|
||||
// the following switch intentionally omits break keywords
|
||||
// to utilize falling through the cases.
|
||||
switch (units) {
|
||||
case 'year':
|
||||
this.month(0);
|
||||
/* falls through */
|
||||
case 'quarter':
|
||||
case 'month':
|
||||
this.date(1);
|
||||
/* falls through */
|
||||
case 'week':
|
||||
case 'isoWeek':
|
||||
case 'day':
|
||||
case 'date':
|
||||
this.hours(0);
|
||||
/* falls through */
|
||||
case 'hour':
|
||||
this.minutes(0);
|
||||
/* falls through */
|
||||
case 'minute':
|
||||
this.seconds(0);
|
||||
/* falls through */
|
||||
case 'second':
|
||||
this.milliseconds(0);
|
||||
}
|
||||
|
||||
// weeks are a special case
|
||||
if (units === 'week') {
|
||||
this.weekday(0);
|
||||
}
|
||||
if (units === 'isoWeek') {
|
||||
this.isoWeekday(1);
|
||||
}
|
||||
|
||||
// quarters are also special
|
||||
if (units === 'quarter') {
|
||||
this.month(Math.floor(this.month() / 3) * 3);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
export function endOf (units) {
|
||||
units = normalizeUnits(units);
|
||||
if (units === undefined || units === 'millisecond') {
|
||||
return this;
|
||||
}
|
||||
|
||||
// 'date' is an alias for 'day', so it should be considered as such.
|
||||
if (units === 'date') {
|
||||
units = 'day';
|
||||
}
|
||||
|
||||
return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
|
||||
}
|
||||
34
public/bower_components/moment/src/lib/moment/to-type.js
vendored
Executable file
34
public/bower_components/moment/src/lib/moment/to-type.js
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
export function valueOf () {
|
||||
return this._d.valueOf() - ((this._offset || 0) * 60000);
|
||||
}
|
||||
|
||||
export function unix () {
|
||||
return Math.floor(this.valueOf() / 1000);
|
||||
}
|
||||
|
||||
export function toDate () {
|
||||
return new Date(this.valueOf());
|
||||
}
|
||||
|
||||
export function toArray () {
|
||||
var m = this;
|
||||
return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
|
||||
}
|
||||
|
||||
export function toObject () {
|
||||
var m = this;
|
||||
return {
|
||||
years: m.year(),
|
||||
months: m.month(),
|
||||
date: m.date(),
|
||||
hours: m.hours(),
|
||||
minutes: m.minutes(),
|
||||
seconds: m.seconds(),
|
||||
milliseconds: m.milliseconds()
|
||||
};
|
||||
}
|
||||
|
||||
export function toJSON () {
|
||||
// new Date(NaN).toJSON() === null
|
||||
return this.isValid() ? this.toISOString() : null;
|
||||
}
|
||||
17
public/bower_components/moment/src/lib/moment/to.js
vendored
Executable file
17
public/bower_components/moment/src/lib/moment/to.js
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
import { createDuration } from '../duration/create';
|
||||
import { createLocal } from '../create/local';
|
||||
import { isMoment } from '../moment/constructor';
|
||||
|
||||
export function to (time, withoutSuffix) {
|
||||
if (this.isValid() &&
|
||||
((isMoment(time) && time.isValid()) ||
|
||||
createLocal(time).isValid())) {
|
||||
return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
|
||||
} else {
|
||||
return this.localeData().invalidDate();
|
||||
}
|
||||
}
|
||||
|
||||
export function toNow (withoutSuffix) {
|
||||
return this.to(createLocal(), withoutSuffix);
|
||||
}
|
||||
15
public/bower_components/moment/src/lib/moment/valid.js
vendored
Executable file
15
public/bower_components/moment/src/lib/moment/valid.js
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
import { isValid as _isValid } from '../create/valid';
|
||||
import extend from '../utils/extend';
|
||||
import getParsingFlags from '../create/parsing-flags';
|
||||
|
||||
export function isValid () {
|
||||
return _isValid(this);
|
||||
}
|
||||
|
||||
export function parsingFlags () {
|
||||
return extend({}, getParsingFlags(this));
|
||||
}
|
||||
|
||||
export function invalidAt () {
|
||||
return getParsingFlags(this).overflow;
|
||||
}
|
||||
Reference in New Issue
Block a user