Skip to content
Snippets Groups Projects
index.js 7.33 MiB
Newer Older
  • Learn to ignore specific revisions
  • Romain CREY's avatar
    Romain CREY committed
            return this;
        }
    
    
        function valueOf() {
            return this._d.valueOf() - (this._offset || 0) * 60000;
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    
        function unix() {
    
    Romain CREY's avatar
    Romain CREY committed
            return Math.floor(this.valueOf() / 1000);
        }
    
    
        function toDate() {
    
    Romain CREY's avatar
    Romain CREY committed
            return new Date(this.valueOf());
        }
    
    
        function toArray() {
    
    Romain CREY's avatar
    Romain CREY committed
            var m = this;
    
            return [
                m.year(),
                m.month(),
                m.date(),
                m.hour(),
                m.minute(),
                m.second(),
                m.millisecond(),
            ];
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    
        function toObject() {
    
    Romain CREY's avatar
    Romain CREY committed
            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(),
    
        function toJSON() {
    
    Romain CREY's avatar
    Romain CREY committed
            // new Date(NaN).toJSON() === null
            return this.isValid() ? this.toISOString() : null;
        }
    
    
        function isValid$2() {
    
    Romain CREY's avatar
    Romain CREY committed
            return isValid(this);
        }
    
    
        function parsingFlags() {
    
    Romain CREY's avatar
    Romain CREY committed
            return extend({}, getParsingFlags(this));
        }
    
    
        function invalidAt() {
    
    Romain CREY's avatar
    Romain CREY committed
            return getParsingFlags(this).overflow;
        }
    
        function creationData() {
            return {
                input: this._i,
                format: this._f,
                locale: this._locale,
                isUTC: this._isUTC,
    
                strict: this._strict,
    
    195069 195070 195071 195072 195073 195074 195075 195076 195077 195078 195079 195080 195081 195082 195083 195084 195085 195086 195087 195088 195089 195090 195091 195092 195093 195094 195095 195096 195097 195098 195099 195100 195101 195102 195103 195104 195105 195106 195107 195108 195109 195110 195111 195112 195113 195114 195115 195116 195117 195118 195119 195120 195121 195122 195123 195124 195125 195126 195127 195128 195129 195130 195131 195132 195133 195134 195135 195136 195137 195138 195139 195140 195141 195142 195143 195144 195145 195146 195147 195148 195149 195150 195151 195152 195153 195154 195155 195156 195157 195158 195159 195160 195161 195162 195163 195164 195165 195166 195167 195168 195169 195170 195171 195172 195173 195174 195175 195176 195177 195178 195179 195180 195181 195182 195183 195184 195185 195186 195187 195188 195189 195190 195191 195192 195193 195194 195195 195196 195197 195198 195199 195200 195201 195202 195203 195204 195205 195206 195207 195208 195209 195210 195211 195212 195213 195214 195215 195216 195217 195218 195219 195220 195221 195222 195223 195224 195225 195226 195227 195228 195229 195230 195231 195232 195233 195234 195235 195236 195237 195238 195239 195240 195241 195242 195243 195244 195245 195246 195247 195248 195249 195250 195251 195252 195253 195254 195255 195256 195257 195258 195259 195260 195261 195262 195263 195264 195265 195266 195267 195268 195269 195270 195271 195272 195273 195274 195275 195276 195277 195278 195279 195280 195281 195282 195283 195284 195285 195286 195287 195288 195289 195290 195291 195292 195293 195294 195295 195296 195297 195298 195299 195300 195301 195302 195303 195304 195305 195306 195307 195308 195309 195310 195311 195312 195313 195314 195315 195316 195317 195318 195319 195320 195321 195322 195323 195324 195325 195326 195327 195328 195329 195330 195331 195332 195333 195334 195335 195336 195337 195338 195339 195340 195341 195342 195343 195344 195345 195346 195347 195348 195349
        addFormatToken('N', 0, 0, 'eraAbbr');
        addFormatToken('NN', 0, 0, 'eraAbbr');
        addFormatToken('NNN', 0, 0, 'eraAbbr');
        addFormatToken('NNNN', 0, 0, 'eraName');
        addFormatToken('NNNNN', 0, 0, 'eraNarrow');
    
        addFormatToken('y', ['y', 1], 'yo', 'eraYear');
        addFormatToken('y', ['yy', 2], 0, 'eraYear');
        addFormatToken('y', ['yyy', 3], 0, 'eraYear');
        addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
    
        addRegexToken('N', matchEraAbbr);
        addRegexToken('NN', matchEraAbbr);
        addRegexToken('NNN', matchEraAbbr);
        addRegexToken('NNNN', matchEraName);
        addRegexToken('NNNNN', matchEraNarrow);
    
        addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
            input,
            array,
            config,
            token
        ) {
            var era = config._locale.erasParse(input, token, config._strict);
            if (era) {
                getParsingFlags(config).era = era;
            } else {
                getParsingFlags(config).invalidEra = input;
            }
        });
    
        addRegexToken('y', matchUnsigned);
        addRegexToken('yy', matchUnsigned);
        addRegexToken('yyy', matchUnsigned);
        addRegexToken('yyyy', matchUnsigned);
        addRegexToken('yo', matchEraYearOrdinal);
    
        addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
        addParseToken(['yo'], function (input, array, config, token) {
            var match;
            if (config._locale._eraYearOrdinalRegex) {
                match = input.match(config._locale._eraYearOrdinalRegex);
            }
    
            if (config._locale.eraYearOrdinalParse) {
                array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
            } else {
                array[YEAR] = parseInt(input, 10);
            }
        });
    
        function localeEras(m, format) {
            var i,
                l,
                date,
                eras = this._eras || getLocale('en')._eras;
            for (i = 0, l = eras.length; i < l; ++i) {
                switch (typeof eras[i].since) {
                    case 'string':
                        // truncate time
                        date = hooks(eras[i].since).startOf('day');
                        eras[i].since = date.valueOf();
                        break;
                }
    
                switch (typeof eras[i].until) {
                    case 'undefined':
                        eras[i].until = +Infinity;
                        break;
                    case 'string':
                        // truncate time
                        date = hooks(eras[i].until).startOf('day').valueOf();
                        eras[i].until = date.valueOf();
                        break;
                }
            }
            return eras;
        }
    
        function localeErasParse(eraName, format, strict) {
            var i,
                l,
                eras = this.eras(),
                name,
                abbr,
                narrow;
            eraName = eraName.toUpperCase();
    
            for (i = 0, l = eras.length; i < l; ++i) {
                name = eras[i].name.toUpperCase();
                abbr = eras[i].abbr.toUpperCase();
                narrow = eras[i].narrow.toUpperCase();
    
                if (strict) {
                    switch (format) {
                        case 'N':
                        case 'NN':
                        case 'NNN':
                            if (abbr === eraName) {
                                return eras[i];
                            }
                            break;
    
                        case 'NNNN':
                            if (name === eraName) {
                                return eras[i];
                            }
                            break;
    
                        case 'NNNNN':
                            if (narrow === eraName) {
                                return eras[i];
                            }
                            break;
                    }
                } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
                    return eras[i];
                }
            }
        }
    
        function localeErasConvertYear(era, year) {
            var dir = era.since <= era.until ? +1 : -1;
            if (year === undefined) {
                return hooks(era.since).year();
            } else {
                return hooks(era.since).year() + (year - era.offset) * dir;
            }
        }
    
        function getEraName() {
            var i,
                l,
                val,
                eras = this.localeData().eras();
            for (i = 0, l = eras.length; i < l; ++i) {
                // truncate time
                val = this.clone().startOf('day').valueOf();
    
                if (eras[i].since <= val && val <= eras[i].until) {
                    return eras[i].name;
                }
                if (eras[i].until <= val && val <= eras[i].since) {
                    return eras[i].name;
                }
            }
    
            return '';
        }
    
        function getEraNarrow() {
            var i,
                l,
                val,
                eras = this.localeData().eras();
            for (i = 0, l = eras.length; i < l; ++i) {
                // truncate time
                val = this.clone().startOf('day').valueOf();
    
                if (eras[i].since <= val && val <= eras[i].until) {
                    return eras[i].narrow;
                }
                if (eras[i].until <= val && val <= eras[i].since) {
                    return eras[i].narrow;
                }
            }
    
            return '';
        }
    
        function getEraAbbr() {
            var i,
                l,
                val,
                eras = this.localeData().eras();
            for (i = 0, l = eras.length; i < l; ++i) {
                // truncate time
                val = this.clone().startOf('day').valueOf();
    
                if (eras[i].since <= val && val <= eras[i].until) {
                    return eras[i].abbr;
                }
                if (eras[i].until <= val && val <= eras[i].since) {
                    return eras[i].abbr;
                }
            }
    
            return '';
        }
    
        function getEraYear() {
            var i,
                l,
                dir,
                val,
                eras = this.localeData().eras();
            for (i = 0, l = eras.length; i < l; ++i) {
                dir = eras[i].since <= eras[i].until ? +1 : -1;
    
                // truncate time
                val = this.clone().startOf('day').valueOf();
    
                if (
                    (eras[i].since <= val && val <= eras[i].until) ||
                    (eras[i].until <= val && val <= eras[i].since)
                ) {
                    return (
                        (this.year() - hooks(eras[i].since).year()) * dir +
                        eras[i].offset
                    );
                }
            }
    
            return this.year();
        }
    
        function erasNameRegex(isStrict) {
            if (!hasOwnProp(this, '_erasNameRegex')) {
                computeErasParse.call(this);
            }
            return isStrict ? this._erasNameRegex : this._erasRegex;
        }
    
        function erasAbbrRegex(isStrict) {
            if (!hasOwnProp(this, '_erasAbbrRegex')) {
                computeErasParse.call(this);
            }
            return isStrict ? this._erasAbbrRegex : this._erasRegex;
        }
    
        function erasNarrowRegex(isStrict) {
            if (!hasOwnProp(this, '_erasNarrowRegex')) {
                computeErasParse.call(this);
            }
            return isStrict ? this._erasNarrowRegex : this._erasRegex;
        }
    
        function matchEraAbbr(isStrict, locale) {
            return locale.erasAbbrRegex(isStrict);
        }
    
        function matchEraName(isStrict, locale) {
            return locale.erasNameRegex(isStrict);
        }
    
        function matchEraNarrow(isStrict, locale) {
            return locale.erasNarrowRegex(isStrict);
        }
    
        function matchEraYearOrdinal(isStrict, locale) {
            return locale._eraYearOrdinalRegex || matchUnsigned;
        }
    
        function computeErasParse() {
            var abbrPieces = [],
                namePieces = [],
                narrowPieces = [],
                mixedPieces = [],
                i,
                l,
                eras = this.eras();
    
            for (i = 0, l = eras.length; i < l; ++i) {
                namePieces.push(regexEscape(eras[i].name));
                abbrPieces.push(regexEscape(eras[i].abbr));
                narrowPieces.push(regexEscape(eras[i].narrow));
    
                mixedPieces.push(regexEscape(eras[i].name));
                mixedPieces.push(regexEscape(eras[i].abbr));
                mixedPieces.push(regexEscape(eras[i].narrow));
            }
    
            this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
            this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
            this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
            this._erasNarrowRegex = new RegExp(
                '^(' + narrowPieces.join('|') + ')',
                'i'
            );
        }
    
    
    Romain CREY's avatar
    Romain CREY committed
        // FORMATTING
    
        addFormatToken(0, ['gg', 2], 0, function () {
            return this.weekYear() % 100;
        });
    
        addFormatToken(0, ['GG', 2], 0, function () {
            return this.isoWeekYear() % 100;
        });
    
    
        function addWeekYearFormatToken(token, getter) {
    
    Romain CREY's avatar
    Romain CREY committed
            addFormatToken(0, [token, token.length], 0, getter);
        }
    
    
        addWeekYearFormatToken('gggg', 'weekYear');
        addWeekYearFormatToken('ggggg', 'weekYear');
        addWeekYearFormatToken('GGGG', 'isoWeekYear');
    
    Romain CREY's avatar
    Romain CREY committed
        addWeekYearFormatToken('GGGGG', 'isoWeekYear');
    
        // ALIASES
    
        addUnitAlias('weekYear', 'gg');
        addUnitAlias('isoWeekYear', 'GG');
    
        // PRIORITY
    
        addUnitPriority('weekYear', 1);
        addUnitPriority('isoWeekYear', 1);
    
        // PARSING
    
    
        addRegexToken('G', matchSigned);
        addRegexToken('g', matchSigned);
        addRegexToken('GG', match1to2, match2);
        addRegexToken('gg', match1to2, match2);
        addRegexToken('GGGG', match1to4, match4);
        addRegexToken('gggg', match1to4, match4);
        addRegexToken('GGGGG', match1to6, match6);
        addRegexToken('ggggg', match1to6, match6);
    
        addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
            input,
            week,
            config,
            token
        ) {
    
    Romain CREY's avatar
    Romain CREY committed
            week[token.substr(0, 2)] = toInt(input);
        });
    
        addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
            week[token] = hooks.parseTwoDigitYear(input);
        });
    
        // MOMENTS
    
    
        function getSetWeekYear(input) {
            return getSetWeekYearHelper.call(
                this,
                input,
                this.week(),
                this.weekday(),
                this.localeData()._week.dow,
                this.localeData()._week.doy
            );
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    
        function getSetISOWeekYear(input) {
            return getSetWeekYearHelper.call(
                this,
                input,
                this.isoWeek(),
                this.isoWeekday(),
                1,
                4
            );
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    
        function getISOWeeksInYear() {
    
    Romain CREY's avatar
    Romain CREY committed
            return weeksInYear(this.year(), 1, 4);
        }
    
    
        function getISOWeeksInISOWeekYear() {
            return weeksInYear(this.isoWeekYear(), 1, 4);
        }
    
        function getWeeksInYear() {
    
    Romain CREY's avatar
    Romain CREY committed
            var weekInfo = this.localeData()._week;
            return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
        }
    
    
        function getWeeksInWeekYear() {
            var weekInfo = this.localeData()._week;
            return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
        }
    
    
    Romain CREY's avatar
    Romain CREY committed
        function getSetWeekYearHelper(input, week, weekday, dow, doy) {
            var weeksTarget;
            if (input == null) {
                return weekOfYear(this, dow, doy).year;
            } else {
                weeksTarget = weeksInYear(input, dow, doy);
                if (week > weeksTarget) {
                    week = weeksTarget;
                }
                return setWeekAll.call(this, input, week, weekday, dow, doy);
            }
        }
    
        function setWeekAll(weekYear, week, weekday, dow, doy) {
            var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
                date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
    
            this.year(date.getUTCFullYear());
            this.month(date.getUTCMonth());
            this.date(date.getUTCDate());
            return this;
        }
    
        // FORMATTING
    
        addFormatToken('Q', 0, 'Qo', 'quarter');
    
        // ALIASES
    
        addUnitAlias('quarter', 'Q');
    
        // PRIORITY
    
        addUnitPriority('quarter', 7);
    
        // PARSING
    
        addRegexToken('Q', match1);
        addParseToken('Q', function (input, array) {
            array[MONTH] = (toInt(input) - 1) * 3;
        });
    
        // MOMENTS
    
    
        function getSetQuarter(input) {
            return input == null
                ? Math.ceil((this.month() + 1) / 3)
                : this.month((input - 1) * 3 + (this.month() % 3));
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        // FORMATTING
    
        addFormatToken('D', ['DD', 2], 'Do', 'date');
    
        // ALIASES
    
        addUnitAlias('date', 'D');
    
        // PRIORITY
        addUnitPriority('date', 9);
    
        // PARSING
    
    
        addRegexToken('D', match1to2);
    
    Romain CREY's avatar
    Romain CREY committed
        addRegexToken('DD', match1to2, match2);
        addRegexToken('Do', function (isStrict, locale) {
            // TODO: Remove "ordinalParse" fallback in next major release.
    
            return isStrict
                ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
                : locale._dayOfMonthOrdinalParseLenient;
    
    Romain CREY's avatar
    Romain CREY committed
        });
    
        addParseToken(['D', 'DD'], DATE);
        addParseToken('Do', function (input, array) {
            array[DATE] = toInt(input.match(match1to2)[0]);
        });
    
        // MOMENTS
    
        var getSetDayOfMonth = makeGetSet('Date', true);
    
        // FORMATTING
    
        addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
    
        // ALIASES
    
        addUnitAlias('dayOfYear', 'DDD');
    
        // PRIORITY
        addUnitPriority('dayOfYear', 4);
    
        // PARSING
    
    
        addRegexToken('DDD', match1to3);
    
    Romain CREY's avatar
    Romain CREY committed
        addRegexToken('DDDD', match3);
        addParseToken(['DDD', 'DDDD'], function (input, array, config) {
            config._dayOfYear = toInt(input);
        });
    
        // HELPERS
    
        // MOMENTS
    
    
        function getSetDayOfYear(input) {
            var dayOfYear =
                Math.round(
                    (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
                ) + 1;
            return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        // FORMATTING
    
        addFormatToken('m', ['mm', 2], 0, 'minute');
    
        // ALIASES
    
        addUnitAlias('minute', 'm');
    
        // PRIORITY
    
        addUnitPriority('minute', 14);
    
        // PARSING
    
    
        addRegexToken('m', match1to2);
    
    Romain CREY's avatar
    Romain CREY committed
        addRegexToken('mm', match1to2, match2);
        addParseToken(['m', 'mm'], MINUTE);
    
        // MOMENTS
    
        var getSetMinute = makeGetSet('Minutes', false);
    
        // FORMATTING
    
        addFormatToken('s', ['ss', 2], 0, 'second');
    
        // ALIASES
    
        addUnitAlias('second', 's');
    
        // PRIORITY
    
        addUnitPriority('second', 15);
    
        // PARSING
    
    
        addRegexToken('s', match1to2);
    
    Romain CREY's avatar
    Romain CREY committed
        addRegexToken('ss', match1to2, match2);
        addParseToken(['s', 'ss'], SECOND);
    
        // MOMENTS
    
        var getSetSecond = makeGetSet('Seconds', false);
    
        // FORMATTING
    
        addFormatToken('S', 0, 0, function () {
            return ~~(this.millisecond() / 100);
        });
    
        addFormatToken(0, ['SS', 2], 0, function () {
            return ~~(this.millisecond() / 10);
        });
    
        addFormatToken(0, ['SSS', 3], 0, 'millisecond');
        addFormatToken(0, ['SSSS', 4], 0, function () {
            return this.millisecond() * 10;
        });
        addFormatToken(0, ['SSSSS', 5], 0, function () {
            return this.millisecond() * 100;
        });
        addFormatToken(0, ['SSSSSS', 6], 0, function () {
            return this.millisecond() * 1000;
        });
        addFormatToken(0, ['SSSSSSS', 7], 0, function () {
            return this.millisecond() * 10000;
        });
        addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
            return this.millisecond() * 100000;
        });
        addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
            return this.millisecond() * 1000000;
        });
    
        // ALIASES
    
        addUnitAlias('millisecond', 'ms');
    
        // PRIORITY
    
        addUnitPriority('millisecond', 16);
    
        // PARSING
    
    
        addRegexToken('S', match1to3, match1);
        addRegexToken('SS', match1to3, match2);
        addRegexToken('SSS', match1to3, match3);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        var token, getSetMillisecond;
    
    Romain CREY's avatar
    Romain CREY committed
        for (token = 'SSSS'; token.length <= 9; token += 'S') {
            addRegexToken(token, matchUnsigned);
        }
    
        function parseMs(input, array) {
            array[MILLISECOND] = toInt(('0.' + input) * 1000);
        }
    
        for (token = 'S'; token.length <= 9; token += 'S') {
            addParseToken(token, parseMs);
        }
    
    
        getSetMillisecond = makeGetSet('Milliseconds', false);
    
    Romain CREY's avatar
    Romain CREY committed
    
        // FORMATTING
    
    
        addFormatToken('z', 0, 0, 'zoneAbbr');
    
    Romain CREY's avatar
    Romain CREY committed
        addFormatToken('zz', 0, 0, 'zoneName');
    
        // MOMENTS
    
    
        function getZoneAbbr() {
    
    Romain CREY's avatar
    Romain CREY committed
            return this._isUTC ? 'UTC' : '';
        }
    
    
        function getZoneName() {
    
    Romain CREY's avatar
    Romain CREY committed
            return this._isUTC ? 'Coordinated Universal Time' : '';
        }
    
        var proto = Moment.prototype;
    
    
        proto.add = add;
        proto.calendar = calendar$1;
        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$2;
        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.inspect = inspect;
        if (typeof Symbol !== 'undefined' && Symbol.for != null) {
            proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
                return 'Moment<' + this.format() + '>';
            };
        }
        proto.toJSON = toJSON;
        proto.toString = toString;
        proto.unix = unix;
        proto.valueOf = valueOf;
        proto.creationData = creationData;
        proto.eraName = getEraName;
        proto.eraNarrow = getEraNarrow;
        proto.eraAbbr = getEraAbbr;
        proto.eraYear = getEraYear;
        proto.year = getSetYear;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.isLeapYear = getIsLeapYear;
    
        proto.weekYear = getSetWeekYear;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.isoWeekYear = getSetISOWeekYear;
        proto.quarter = proto.quarters = getSetQuarter;
    
        proto.month = getSetMonth;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.daysInMonth = getDaysInMonth;
    
        proto.week = proto.weeks = getSetWeek;
        proto.isoWeek = proto.isoWeeks = getSetISOWeek;
        proto.weeksInYear = getWeeksInYear;
        proto.weeksInWeekYear = getWeeksInWeekYear;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.isoWeeksInYear = getISOWeeksInYear;
    
        proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
        proto.date = getSetDayOfMonth;
        proto.day = proto.days = getSetDayOfWeek;
        proto.weekday = getSetLocaleDayOfWeek;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.isoWeekday = getSetISODayOfWeek;
    
        proto.dayOfYear = getSetDayOfYear;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.hour = proto.hours = getSetHour;
        proto.minute = proto.minutes = getSetMinute;
        proto.second = proto.seconds = getSetSecond;
        proto.millisecond = proto.milliseconds = getSetMillisecond;
    
        proto.utcOffset = getSetOffset;
        proto.utc = setOffsetToUTC;
        proto.local = setOffsetToLocal;
        proto.parseZone = setOffsetToParsedOffset;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.hasAlignedHourOffset = hasAlignedHourOffset;
    
        proto.isDST = isDaylightSavingTime;
        proto.isLocal = isLocal;
        proto.isUtcOffset = isUtcOffset;
        proto.isUtc = isUtc;
        proto.isUTC = isUtc;
    
    Romain CREY's avatar
    Romain CREY committed
        proto.zoneAbbr = getZoneAbbr;
        proto.zoneName = getZoneName;
    
        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
        );
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        function createUnix(input) {
    
    Romain CREY's avatar
    Romain CREY committed
            return createLocal(input * 1000);
        }
    
    
        function createInZone() {
    
    Romain CREY's avatar
    Romain CREY committed
            return createLocal.apply(null, arguments).parseZone();
        }
    
    
        function preParsePostFormat(string) {
    
    Romain CREY's avatar
    Romain CREY committed
            return string;
        }
    
        var proto$1 = Locale.prototype;
    
    
        proto$1.calendar = calendar;
        proto$1.longDateFormat = longDateFormat;
        proto$1.invalidDate = invalidDate;
        proto$1.ordinal = ordinal;
        proto$1.preparse = preParsePostFormat;
        proto$1.postformat = preParsePostFormat;
        proto$1.relativeTime = relativeTime;
        proto$1.pastFuture = pastFuture;
        proto$1.set = set;
        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;
    
    Romain CREY's avatar
    Romain CREY committed
        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;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        proto$1.weekdaysRegex = weekdaysRegex;
        proto$1.weekdaysShortRegex = weekdaysShortRegex;
        proto$1.weekdaysMinRegex = weekdaysMinRegex;
    
    Romain CREY's avatar
    Romain CREY committed
    
        proto$1.isPM = localeIsPM;
        proto$1.meridiem = localeMeridiem;
    
    
        function get$1(format, index, field, setter) {
            var locale = getLocale(),
                utc = createUTC().set(setter, index);
    
    Romain CREY's avatar
    Romain CREY committed
            return locale[field](utc, format);
        }
    
    
        function listMonthsImpl(format, index, field) {
    
    Romain CREY's avatar
    Romain CREY committed
            if (isNumber(format)) {
                index = format;
                format = undefined;
            }
    
            format = format || '';
    
            if (index != null) {
                return get$1(format, index, field, 'month');
            }
    
    
            var i,
                out = [];
    
    Romain CREY's avatar
    Romain CREY committed
            for (i = 0; i < 12; i++) {
                out[i] = get$1(format, i, field, 'month');
            }
            return out;
        }
    
        // ()
        // (5)
        // (fmt, 5)
        // (fmt)
        // (true)
        // (true, 5)
        // (true, fmt, 5)
        // (true, fmt)
    
        function listWeekdaysImpl(localeSorted, format, index, field) {
    
    Romain CREY's avatar
    Romain CREY committed
            if (typeof localeSorted === 'boolean') {
                if (isNumber(format)) {
                    index = format;
                    format = undefined;
                }
    
                format = format || '';
            } else {
                format = localeSorted;
                index = format;
                localeSorted = false;
    
                if (isNumber(format)) {
                    index = format;
                    format = undefined;
                }
    
                format = format || '';
            }
    
            var locale = getLocale(),
    
                shift = localeSorted ? locale._week.dow : 0,
                i,
                out = [];
    
    Romain CREY's avatar
    Romain CREY committed
    
            if (index != null) {
                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');
            }
            return out;
        }
    
    
        function listMonths(format, index) {
    
    Romain CREY's avatar
    Romain CREY committed
            return listMonthsImpl(format, index, 'months');
        }
    
    
        function listMonthsShort(format, index) {
    
    Romain CREY's avatar
    Romain CREY committed
            return listMonthsImpl(format, index, 'monthsShort');
        }
    
    
        function listWeekdays(localeSorted, format, index) {
    
    Romain CREY's avatar
    Romain CREY committed
            return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
        }
    
    
        function listWeekdaysShort(localeSorted, format, index) {
    
    Romain CREY's avatar
    Romain CREY committed
            return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
        }
    
    
        function listWeekdaysMin(localeSorted, format, index) {
    
    Romain CREY's avatar
    Romain CREY committed
            return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
        }
    
        getSetGlobalLocale('en', {
    
            eras: [
                {
                    since: '0001-01-01',
                    until: +Infinity,
                    offset: 1,
                    name: 'Anno Domini',
                    narrow: 'AD',
                    abbr: 'AD',
                },
                {
                    since: '0000-12-31',
                    until: -Infinity,
                    offset: 1,
                    name: 'Before Christ',
                    narrow: 'BC',
                    abbr: 'BC',
                },
            ],
    
    Romain CREY's avatar
    Romain CREY committed
            dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
    
            ordinal: function (number) {
    
    Romain CREY's avatar
    Romain CREY committed
                var b = number % 10,
    
                    output =
                        toInt((number % 100) / 10) === 1
                            ? 'th'
                            : b === 1
                            ? 'st'
                            : b === 2
                            ? 'nd'
                            : b === 3
                            ? 'rd'
                            : 'th';
    
    Romain CREY's avatar
    Romain CREY committed
                return number + output;
    
    Romain CREY's avatar
    Romain CREY committed
        });
    
        // Side effect imports
    
    
        hooks.lang = deprecate(
            'moment.lang is deprecated. Use moment.locale instead.',
            getSetGlobalLocale
        );
        hooks.langData = deprecate(
            'moment.langData is deprecated. Use moment.localeData instead.',
            getLocale
        );
    
    Romain CREY's avatar
    Romain CREY committed
    
        var mathAbs = Math.abs;
    
    
        function abs() {
            var data = this._data;
    
    Romain CREY's avatar
    Romain CREY committed
    
            this._milliseconds = mathAbs(this._milliseconds);
    
            this._days = mathAbs(this._days);
            this._months = mathAbs(this._months);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            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);
    
    Romain CREY's avatar
    Romain CREY committed
    
            return this;
        }
    
    
        function addSubtract$1(duration, input, value, direction) {
    
    Romain CREY's avatar
    Romain CREY committed
            var other = createDuration(input, value);
    
            duration._milliseconds += direction * other._milliseconds;
    
            duration._days += direction * other._days;
            duration._months += direction * other._months;
    
    Romain CREY's avatar
    Romain CREY committed
    
            return duration._bubble();
        }
    
        // supports only 2.0-style add(1, 's') or add(duration)
    
        function add$1(input, value) {
    
    Romain CREY's avatar
    Romain CREY committed
            return addSubtract$1(this, input, value, 1);
        }