Skip to content

Commit

Permalink
Update Moment to 2.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
c0shea committed Mar 12, 2018
1 parent 65303a9 commit bdf8736
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 66 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AdminLTE Template

The AdminLTE Template is a ready-to-go template for constructing high-quality ASP.NET MVC projects.
The template also includes other useful plugins, such as Select2.
The template also includes other useful plugins.

This template aims to make development faster and easier since the basic structure of all the
dependencies is already defined.
Expand All @@ -27,7 +27,6 @@ by [Abdullah Almsaeed](https://almsaeedstudio.com/).
| iCheck | 1.0.1 | [GitHub](https://github.com/fronteed/iCheck/)
| Inputmask | 3.3.11 | [GitHub](http://github.com/RobinHerbots/jquery.inputmask)
| jQuery | 2.2.4 | [GitHub](https://github.com/jquery/jquery)
| Moment.js | 2.19.3 | [GitHub](https://github.com/moment/moment/)
| Select2 | 4.0.4 | [GitHub](https://github.com/select2/select2)
| Moment.js | 2.21.0 | [GitHub](https://github.com/moment/moment/)
| slimScroll | 1.3.8 | [GitHub](https://github.com/rochal/jQuery-slimScroll)
| WebHelpers.Mvc5 | 1.0.0 | [GitHub](https://github.com/c0shea/WebHelpers.Mvc5)
| WebHelpers.Mvc5 | 1.2.0 | [GitHub](https://github.com/c0shea/WebHelpers.Mvc5)
113 changes: 52 additions & 61 deletions src/AdminLTE Template/Content/js/plugins/moment/moment.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
//! moment.js
//! version : 2.19.3
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com

;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -659,8 +655,7 @@ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123

// any word (or two) characters or numbers including two/three word month in arabic.
// includes scottish gaelic two word and hyphenated months
var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;

var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;

var regexes = {};

Expand Down Expand Up @@ -1774,10 +1769,6 @@ function localeMeridiem (hours, minutes, isLower) {
// this rule.
var getSetHour = makeGetSet('Hours', true);

// months
// week
// weekdays
// meridiem
var baseConfig = {
calendar: defaultCalendar,
longDateFormat: defaultLongDateFormat,
Expand Down Expand Up @@ -1831,7 +1822,7 @@ function chooseLocale(names) {
}
i++;
}
return null;
return globalLocale;
}

function loadLocale(name) {
Expand Down Expand Up @@ -1866,14 +1857,20 @@ function getSetGlobalLocale (key, values) {
// moment.duration._locale = moment._locale = data;
globalLocale = data;
}
else {
if ((typeof console !== 'undefined') && console.warn) {
//warn user if arguments are passed but the locale could not be set
console.warn('Locale ' + key + ' not found. Did you forget to load it?');
}
}
}

return globalLocale._abbr;
}

function defineLocale (name, config) {
if (config !== null) {
var parentConfig = baseConfig;
var locale, parentConfig = baseConfig;
config.abbr = name;
if (locales[name] != null) {
deprecateSimple('defineLocaleOverride',
Expand All @@ -1886,14 +1883,19 @@ function defineLocale (name, config) {
if (locales[config.parentLocale] != null) {
parentConfig = locales[config.parentLocale]._config;
} else {
if (!localeFamilies[config.parentLocale]) {
localeFamilies[config.parentLocale] = [];
locale = loadLocale(config.parentLocale);
if (locale != null) {
parentConfig = locale._config;
} else {
if (!localeFamilies[config.parentLocale]) {
localeFamilies[config.parentLocale] = [];
}
localeFamilies[config.parentLocale].push({
name: name,
config: config
});
return null;
}
localeFamilies[config.parentLocale].push({
name: name,
config: config
});
return null;
}
}
locales[name] = new Locale(mergeConfigs(parentConfig, config));
Expand Down Expand Up @@ -2029,7 +2031,7 @@ function currentDateArray(config) {
// note: all values past the year are optional and will default to the lowest possible value.
// [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) {
var i, date, input = [], currentDate, yearToUse;
var i, date, input = [], currentDate, expectedWeekday, yearToUse;

if (config._d) {
return;
Expand Down Expand Up @@ -2079,6 +2081,8 @@ function configFromArray (config) {
}

config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();

// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
Expand All @@ -2090,7 +2094,7 @@ function configFromArray (config) {
}

// check for mismatching day of week
if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {
if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
getParsingFlags(config).weekdayMismatch = true;
}
}
Expand Down Expand Up @@ -3239,7 +3243,7 @@ function isSameOrBefore (input, units) {
function diff (input, units, asFloat) {
var that,
zoneDelta,
delta, output;
output;

if (!this.isValid()) {
return NaN;
Expand Down Expand Up @@ -3298,19 +3302,24 @@ function toString () {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}

function toISOString() {
function toISOString(keepOffset) {
if (!this.isValid()) {
return null;
}
var m = this.clone().utc();
var utc = keepOffset !== true;
var m = utc ? this.clone().utc() : this;
if (m.year() < 0 || m.year() > 9999) {
return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
}
if (isFunction(Date.prototype.toISOString)) {
// native implementation is ~50x faster, use it when we can
return this.toDate().toISOString();
if (utc) {
return this.toDate().toISOString();
} else {
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
}
}
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
}

/**
Expand Down Expand Up @@ -3666,7 +3675,7 @@ addRegexToken('Do', function (isStrict, locale) {

addParseToken(['D', 'DD'], DATE);
addParseToken('Do', function (input, array) {
array[DATE] = toInt(input.match(match1to2)[0], 10);
array[DATE] = toInt(input.match(match1to2)[0]);
});

// MOMENTS
Expand Down Expand Up @@ -3861,48 +3870,26 @@ proto.toString = toString;
proto.unix = unix;
proto.valueOf = valueOf;
proto.creationData = creationData;

// Year
proto.year = getSetYear;
proto.isLeapYear = getIsLeapYear;

// Week Year
proto.weekYear = getSetWeekYear;
proto.isoWeekYear = getSetISOWeekYear;

// Quarter
proto.quarter = proto.quarters = getSetQuarter;

// Month
proto.month = getSetMonth;
proto.daysInMonth = getDaysInMonth;

// Week
proto.week = proto.weeks = getSetWeek;
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
proto.weeksInYear = getWeeksInYear;
proto.isoWeeksInYear = getISOWeeksInYear;

// Day
proto.date = getSetDayOfMonth;
proto.day = proto.days = getSetDayOfWeek;
proto.weekday = getSetLocaleDayOfWeek;
proto.isoWeekday = getSetISODayOfWeek;
proto.dayOfYear = getSetDayOfYear;

// Hour
proto.hour = proto.hours = getSetHour;

// Minute
proto.minute = proto.minutes = getSetMinute;

// Second
proto.second = proto.seconds = getSetSecond;

// Millisecond
proto.millisecond = proto.milliseconds = getSetMillisecond;

// Offset
proto.utcOffset = getSetOffset;
proto.utc = setOffsetToUTC;
proto.local = setOffsetToLocal;
Expand All @@ -3913,12 +3900,8 @@ proto.isLocal = isLocal;
proto.isUtcOffset = isUtcOffset;
proto.isUtc = isUtc;
proto.isUTC = isUtc;

// Timezone
proto.zoneAbbr = getZoneAbbr;
proto.zoneName = getZoneName;

// Deprecations
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);
Expand Down Expand Up @@ -3949,19 +3932,15 @@ proto$1.relativeTime = relativeTime;
proto$1.pastFuture = pastFuture;
proto$1.set = set;

// Month
proto$1.months = localeMonths;
proto$1.monthsShort = localeMonthsShort;
proto$1.monthsParse = localeMonthsParse;
proto$1.monthsRegex = monthsRegex;
proto$1.monthsShortRegex = monthsShortRegex;

// Week
proto$1.week = localeWeek;
proto$1.firstDayOfYear = localeFirstDayOfYear;
proto$1.firstDayOfWeek = localeFirstDayOfWeek;

// Day of Week
proto$1.weekdays = localeWeekdays;
proto$1.weekdaysMin = localeWeekdaysMin;
proto$1.weekdaysShort = localeWeekdaysShort;
Expand All @@ -3971,7 +3950,6 @@ proto$1.weekdaysRegex = weekdaysRegex;
proto$1.weekdaysShortRegex = weekdaysShortRegex;
proto$1.weekdaysMinRegex = weekdaysMinRegex;

// Hours
proto$1.isPM = localeIsPM;
proto$1.meridiem = localeMeridiem;

Expand Down Expand Up @@ -4078,6 +4056,7 @@ getSetGlobalLocale('en', {
});

// 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);

Expand Down Expand Up @@ -4453,7 +4432,6 @@ proto$2.toJSON = toISOString$1;
proto$2.locale = locale;
proto$2.localeData = localeData;

// Deprecations
proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
proto$2.lang = lang;

Expand All @@ -4478,7 +4456,7 @@ addParseToken('x', function (input, array, config) {
// Side effect imports


hooks.version = '2.19.3';
hooks.version = '2.21.0';

setHookCallback(createLocal);

Expand Down Expand Up @@ -4510,6 +4488,19 @@ hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
hooks.calendarFormat = getCalendarFormat;
hooks.prototype = proto;

// currently HTML5 input type only supports 24-hour formats
hooks.HTML5_FMT = {
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
DATE: 'YYYY-MM-DD', // <input type="date" />
TIME: 'HH:mm', // <input type="time" />
TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
WEEK: 'YYYY-[W]WW', // <input type="week" />
MONTH: 'YYYY-MM' // <input type="month" />
};

return hooks;

})));

Large diffs are not rendered by default.

0 comments on commit bdf8736

Please sign in to comment.