proto$1.pastFuture = pastFuture;
proto$1.eras = localeEras;
proto$1.erasParse = localeErasParse;
proto$1.erasConvertYear = localeErasConvertYear;
proto$1.erasAbbrRegex = erasAbbrRegex;
proto$1.erasNameRegex = erasNameRegex;
proto$1.erasNarrowRegex = erasNarrowRegex;
proto$1.months = localeMonths;
proto$1.monthsShort = localeMonthsShort;
proto$1.monthsParse = localeMonthsParse;
proto$1.monthsRegex = monthsRegex;
proto$1.monthsShortRegex = monthsShortRegex;
proto$1.week = localeWeek;
proto$1.firstDayOfYear = localeFirstDayOfYear;
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
proto$1.weekdays = localeWeekdays;
proto$1.weekdaysMin = localeWeekdaysMin;
proto$1.weekdaysShort = localeWeekdaysShort;
proto$1.weekdaysParse = localeWeekdaysParse;
proto$1.weekdaysRegex = weekdaysRegex;
proto$1.weekdaysShortRegex = weekdaysShortRegex;
proto$1.weekdaysMinRegex = weekdaysMinRegex;
proto$1.isPM = localeIsPM;
proto$1.meridiem = localeMeridiem;
function get$1(format, index, field, setter) {
var locale = getLocale(),
utc = createUTC().set(setter, index);
return locale[field](utc, format);
function listMonthsImpl(format, index, field) {
return get$1(format, index, field, 'month');
for (i = 0; i < 12; i++) {
out[i] = get$1(format, i, field, 'month');
function listWeekdaysImpl(localeSorted, format, index, field) {
if (typeof localeSorted === 'boolean') {
var locale = getLocale(),
shift = localeSorted ? locale._week.dow : 0,
return get$1(format, (index + shift) % 7, field, 'day');
for (i = 0; i < 7; i++) {
out[i] = get$1(format, (i + shift) % 7, field, 'day');
function listMonths(format, index) {
return listMonthsImpl(format, index, 'months');
function listMonthsShort(format, index) {
return listMonthsImpl(format, index, 'monthsShort');
function listWeekdays(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
function listWeekdaysShort(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
function listWeekdaysMin(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
getSetGlobalLocale('en', {
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal: function (number) {
toInt((number % 100) / 10) === 1
'moment.lang is deprecated. Use moment.locale instead.',
hooks.langData = deprecate(
'moment.langData is deprecated. Use moment.localeData instead.',
this._milliseconds = mathAbs(this._milliseconds);
this._days = mathAbs(this._days);
this._months = mathAbs(this._months);
data.milliseconds = mathAbs(data.milliseconds);
data.seconds = mathAbs(data.seconds);
data.minutes = mathAbs(data.minutes);
data.hours = mathAbs(data.hours);
data.months = mathAbs(data.months);
data.years = mathAbs(data.years);
function addSubtract$1(duration, input, value, direction) {
var other = createDuration(input, value);
duration._milliseconds += direction * other._milliseconds;
duration._days += direction * other._days;
duration._months += direction * other._months;
return duration._bubble();
// supports only 2.0-style add(1, 's') or add(duration)
function add$1(input, value) {
return addSubtract$1(this, input, value, 1);
// supports only 2.0-style subtract(1, 's') or subtract(duration)
function subtract$1(input, value) {
return addSubtract$1(this, input, value, -1);
function absCeil(number) {
return Math.floor(number);
return Math.ceil(number);
var milliseconds = this._milliseconds,
// if we have a mix of positive and negative values, bubble down first
// check: https://github.com/moment/moment/issues/2166
(milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0)
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
// The following code bubbles up values, see the tests for
// examples of what that means.
data.milliseconds = milliseconds % 1000;
seconds = absFloor(milliseconds / 1000);
data.seconds = seconds % 60;
minutes = absFloor(seconds / 60);
data.minutes = minutes % 60;
hours = absFloor(minutes / 60);
days += absFloor(hours / 24);
// convert days to months
monthsFromDays = absFloor(daysToMonths(days));
months += monthsFromDays;
days -= absCeil(monthsToDays(monthsFromDays));
years = absFloor(months / 12);
function daysToMonths(days) {
// 400 years have 146097 days (taking into account leap year rules)
// 400 years have 12 months === 4800
return (days * 4800) / 146097;
function monthsToDays(months) {
// the reverse of daysToMonths
return (months * 146097) / 4800;
milliseconds = this._milliseconds;
units = normalizeUnits(units);
if (units === 'month' || units === 'quarter' || units === 'year') {
days = this._days + milliseconds / 864e5;
months = this._months + daysToMonths(days);
// handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(monthsToDays(this._months));
return days / 7 + milliseconds / 6048e5;
return days + milliseconds / 864e5;
return days * 24 + milliseconds / 36e5;
return days * 1440 + milliseconds / 6e4;
return days * 86400 + milliseconds / 1000;
// Math.floor prevents floating point math errors here
return Math.floor(days * 864e5) + milliseconds;
throw new Error('Unknown unit ' + units);
// TODO: Use this.as('ms')?
(this._months % 12) * 2592e6 +
toInt(this._months / 12) * 31536e6
var asMilliseconds = makeAs('ms'),
asQuarters = makeAs('Q'),
return createDuration(this);
units = normalizeUnits(units);
return this.isValid() ? this[units + 's']() : NaN;
function makeGetter(name) {
return this.isValid() ? this._data[name] : NaN;
var milliseconds = makeGetter('milliseconds'),
seconds = makeGetter('seconds'),
minutes = makeGetter('minutes'),
hours = makeGetter('hours'),
days = makeGetter('days'),
months = makeGetter('months'),
years = makeGetter('years');
return absFloor(this.days() / 7);
ss: 44, // a few seconds to seconds
s: 45, // seconds to minute
m: 45, // minutes to hour
d: 26, // days to month/week
w: null, // weeks to month
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
var duration = createDuration(posNegDuration).abs(),
seconds = round(duration.as('s')),
minutes = round(duration.as('m')),
hours = round(duration.as('h')),
days = round(duration.as('d')),
months = round(duration.as('M')),
weeks = round(duration.as('w')),
years = round(duration.as('y')),
(seconds <= thresholds.ss && ['s', seconds]) ||
(seconds < thresholds.s && ['ss', seconds]) ||
(minutes <= 1 && ['m']) ||
(minutes < thresholds.m && ['mm', minutes]) ||
(hours < thresholds.h && ['hh', hours]) ||
(days < thresholds.d && ['dd', days]);
if (thresholds.w != null) {
(weeks < thresholds.w && ['ww', weeks]);
(months <= 1 && ['M']) ||
(months < thresholds.M && ['MM', months]) ||
(years <= 1 && ['y']) || ['yy', years];
a[3] = +posNegDuration > 0;
return substituteTimeAgo.apply(null, a);
// This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding(roundingFunction) {
if (roundingFunction === undefined) {
if (typeof roundingFunction === 'function') {
round = roundingFunction;
// This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold(threshold, limit) {
if (thresholds[threshold] === undefined) {
if (limit === undefined) {
return thresholds[threshold];
thresholds[threshold] = limit;
thresholds.ss = limit - 1;
function humanize(argWithSuffix, argThresholds) {
return this.localeData().invalidDate();
if (typeof argWithSuffix === 'object') {
argThresholds = argWithSuffix;
if (typeof argWithSuffix === 'boolean') {
withSuffix = argWithSuffix;
if (typeof argThresholds === 'object') {
th = Object.assign({}, thresholds, argThresholds);
if (argThresholds.s != null && argThresholds.ss == null) {
th.ss = argThresholds.s - 1;
locale = this.localeData();
output = relativeTime$1(this, !withSuffix, th, locale);
output = locale.pastFuture(+this, output);
return locale.postformat(output);
return (x > 0) - (x < 0) || +x;
function toISOString$1() {