Edit File by line
/home/barbar84/www/wp-inclu.../js/dist/vendor
File: moment.js
mom,
[1000] Fix | Delete
''
[1001] Fix | Delete
).toLocaleLowerCase();
[1002] Fix | Delete
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
[1003] Fix | Delete
}
[1004] Fix | Delete
}
[1005] Fix | Delete
[1006] Fix | Delete
if (strict) {
[1007] Fix | Delete
if (format === 'MMM') {
[1008] Fix | Delete
ii = indexOf.call(this._shortMonthsParse, llc);
[1009] Fix | Delete
return ii !== -1 ? ii : null;
[1010] Fix | Delete
} else {
[1011] Fix | Delete
ii = indexOf.call(this._longMonthsParse, llc);
[1012] Fix | Delete
return ii !== -1 ? ii : null;
[1013] Fix | Delete
}
[1014] Fix | Delete
} else {
[1015] Fix | Delete
if (format === 'MMM') {
[1016] Fix | Delete
ii = indexOf.call(this._shortMonthsParse, llc);
[1017] Fix | Delete
if (ii !== -1) {
[1018] Fix | Delete
return ii;
[1019] Fix | Delete
}
[1020] Fix | Delete
ii = indexOf.call(this._longMonthsParse, llc);
[1021] Fix | Delete
return ii !== -1 ? ii : null;
[1022] Fix | Delete
} else {
[1023] Fix | Delete
ii = indexOf.call(this._longMonthsParse, llc);
[1024] Fix | Delete
if (ii !== -1) {
[1025] Fix | Delete
return ii;
[1026] Fix | Delete
}
[1027] Fix | Delete
ii = indexOf.call(this._shortMonthsParse, llc);
[1028] Fix | Delete
return ii !== -1 ? ii : null;
[1029] Fix | Delete
}
[1030] Fix | Delete
}
[1031] Fix | Delete
}
[1032] Fix | Delete
[1033] Fix | Delete
function localeMonthsParse(monthName, format, strict) {
[1034] Fix | Delete
var i, mom, regex;
[1035] Fix | Delete
[1036] Fix | Delete
if (this._monthsParseExact) {
[1037] Fix | Delete
return handleStrictParse.call(this, monthName, format, strict);
[1038] Fix | Delete
}
[1039] Fix | Delete
[1040] Fix | Delete
if (!this._monthsParse) {
[1041] Fix | Delete
this._monthsParse = [];
[1042] Fix | Delete
this._longMonthsParse = [];
[1043] Fix | Delete
this._shortMonthsParse = [];
[1044] Fix | Delete
}
[1045] Fix | Delete
[1046] Fix | Delete
// TODO: add sorting
[1047] Fix | Delete
// Sorting makes sure if one month (or abbr) is a prefix of another
[1048] Fix | Delete
// see sorting in computeMonthsParse
[1049] Fix | Delete
for (i = 0; i < 12; i++) {
[1050] Fix | Delete
// make the regex if we don't have it already
[1051] Fix | Delete
mom = createUTC([2000, i]);
[1052] Fix | Delete
if (strict && !this._longMonthsParse[i]) {
[1053] Fix | Delete
this._longMonthsParse[i] = new RegExp(
[1054] Fix | Delete
'^' + this.months(mom, '').replace('.', '') + '$',
[1055] Fix | Delete
'i'
[1056] Fix | Delete
);
[1057] Fix | Delete
this._shortMonthsParse[i] = new RegExp(
[1058] Fix | Delete
'^' + this.monthsShort(mom, '').replace('.', '') + '$',
[1059] Fix | Delete
'i'
[1060] Fix | Delete
);
[1061] Fix | Delete
}
[1062] Fix | Delete
if (!strict && !this._monthsParse[i]) {
[1063] Fix | Delete
regex =
[1064] Fix | Delete
'^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
[1065] Fix | Delete
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
[1066] Fix | Delete
}
[1067] Fix | Delete
// test the regex
[1068] Fix | Delete
if (
[1069] Fix | Delete
strict &&
[1070] Fix | Delete
format === 'MMMM' &&
[1071] Fix | Delete
this._longMonthsParse[i].test(monthName)
[1072] Fix | Delete
) {
[1073] Fix | Delete
return i;
[1074] Fix | Delete
} else if (
[1075] Fix | Delete
strict &&
[1076] Fix | Delete
format === 'MMM' &&
[1077] Fix | Delete
this._shortMonthsParse[i].test(monthName)
[1078] Fix | Delete
) {
[1079] Fix | Delete
return i;
[1080] Fix | Delete
} else if (!strict && this._monthsParse[i].test(monthName)) {
[1081] Fix | Delete
return i;
[1082] Fix | Delete
}
[1083] Fix | Delete
}
[1084] Fix | Delete
}
[1085] Fix | Delete
[1086] Fix | Delete
// MOMENTS
[1087] Fix | Delete
[1088] Fix | Delete
function setMonth(mom, value) {
[1089] Fix | Delete
var dayOfMonth;
[1090] Fix | Delete
[1091] Fix | Delete
if (!mom.isValid()) {
[1092] Fix | Delete
// No op
[1093] Fix | Delete
return mom;
[1094] Fix | Delete
}
[1095] Fix | Delete
[1096] Fix | Delete
if (typeof value === 'string') {
[1097] Fix | Delete
if (/^\d+$/.test(value)) {
[1098] Fix | Delete
value = toInt(value);
[1099] Fix | Delete
} else {
[1100] Fix | Delete
value = mom.localeData().monthsParse(value);
[1101] Fix | Delete
// TODO: Another silent failure?
[1102] Fix | Delete
if (!isNumber(value)) {
[1103] Fix | Delete
return mom;
[1104] Fix | Delete
}
[1105] Fix | Delete
}
[1106] Fix | Delete
}
[1107] Fix | Delete
[1108] Fix | Delete
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
[1109] Fix | Delete
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
[1110] Fix | Delete
return mom;
[1111] Fix | Delete
}
[1112] Fix | Delete
[1113] Fix | Delete
function getSetMonth(value) {
[1114] Fix | Delete
if (value != null) {
[1115] Fix | Delete
setMonth(this, value);
[1116] Fix | Delete
hooks.updateOffset(this, true);
[1117] Fix | Delete
return this;
[1118] Fix | Delete
} else {
[1119] Fix | Delete
return get(this, 'Month');
[1120] Fix | Delete
}
[1121] Fix | Delete
}
[1122] Fix | Delete
[1123] Fix | Delete
function getDaysInMonth() {
[1124] Fix | Delete
return daysInMonth(this.year(), this.month());
[1125] Fix | Delete
}
[1126] Fix | Delete
[1127] Fix | Delete
function monthsShortRegex(isStrict) {
[1128] Fix | Delete
if (this._monthsParseExact) {
[1129] Fix | Delete
if (!hasOwnProp(this, '_monthsRegex')) {
[1130] Fix | Delete
computeMonthsParse.call(this);
[1131] Fix | Delete
}
[1132] Fix | Delete
if (isStrict) {
[1133] Fix | Delete
return this._monthsShortStrictRegex;
[1134] Fix | Delete
} else {
[1135] Fix | Delete
return this._monthsShortRegex;
[1136] Fix | Delete
}
[1137] Fix | Delete
} else {
[1138] Fix | Delete
if (!hasOwnProp(this, '_monthsShortRegex')) {
[1139] Fix | Delete
this._monthsShortRegex = defaultMonthsShortRegex;
[1140] Fix | Delete
}
[1141] Fix | Delete
return this._monthsShortStrictRegex && isStrict
[1142] Fix | Delete
? this._monthsShortStrictRegex
[1143] Fix | Delete
: this._monthsShortRegex;
[1144] Fix | Delete
}
[1145] Fix | Delete
}
[1146] Fix | Delete
[1147] Fix | Delete
function monthsRegex(isStrict) {
[1148] Fix | Delete
if (this._monthsParseExact) {
[1149] Fix | Delete
if (!hasOwnProp(this, '_monthsRegex')) {
[1150] Fix | Delete
computeMonthsParse.call(this);
[1151] Fix | Delete
}
[1152] Fix | Delete
if (isStrict) {
[1153] Fix | Delete
return this._monthsStrictRegex;
[1154] Fix | Delete
} else {
[1155] Fix | Delete
return this._monthsRegex;
[1156] Fix | Delete
}
[1157] Fix | Delete
} else {
[1158] Fix | Delete
if (!hasOwnProp(this, '_monthsRegex')) {
[1159] Fix | Delete
this._monthsRegex = defaultMonthsRegex;
[1160] Fix | Delete
}
[1161] Fix | Delete
return this._monthsStrictRegex && isStrict
[1162] Fix | Delete
? this._monthsStrictRegex
[1163] Fix | Delete
: this._monthsRegex;
[1164] Fix | Delete
}
[1165] Fix | Delete
}
[1166] Fix | Delete
[1167] Fix | Delete
function computeMonthsParse() {
[1168] Fix | Delete
function cmpLenRev(a, b) {
[1169] Fix | Delete
return b.length - a.length;
[1170] Fix | Delete
}
[1171] Fix | Delete
[1172] Fix | Delete
var shortPieces = [],
[1173] Fix | Delete
longPieces = [],
[1174] Fix | Delete
mixedPieces = [],
[1175] Fix | Delete
i,
[1176] Fix | Delete
mom;
[1177] Fix | Delete
for (i = 0; i < 12; i++) {
[1178] Fix | Delete
// make the regex if we don't have it already
[1179] Fix | Delete
mom = createUTC([2000, i]);
[1180] Fix | Delete
shortPieces.push(this.monthsShort(mom, ''));
[1181] Fix | Delete
longPieces.push(this.months(mom, ''));
[1182] Fix | Delete
mixedPieces.push(this.months(mom, ''));
[1183] Fix | Delete
mixedPieces.push(this.monthsShort(mom, ''));
[1184] Fix | Delete
}
[1185] Fix | Delete
// Sorting makes sure if one month (or abbr) is a prefix of another it
[1186] Fix | Delete
// will match the longer piece.
[1187] Fix | Delete
shortPieces.sort(cmpLenRev);
[1188] Fix | Delete
longPieces.sort(cmpLenRev);
[1189] Fix | Delete
mixedPieces.sort(cmpLenRev);
[1190] Fix | Delete
for (i = 0; i < 12; i++) {
[1191] Fix | Delete
shortPieces[i] = regexEscape(shortPieces[i]);
[1192] Fix | Delete
longPieces[i] = regexEscape(longPieces[i]);
[1193] Fix | Delete
}
[1194] Fix | Delete
for (i = 0; i < 24; i++) {
[1195] Fix | Delete
mixedPieces[i] = regexEscape(mixedPieces[i]);
[1196] Fix | Delete
}
[1197] Fix | Delete
[1198] Fix | Delete
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
[1199] Fix | Delete
this._monthsShortRegex = this._monthsRegex;
[1200] Fix | Delete
this._monthsStrictRegex = new RegExp(
[1201] Fix | Delete
'^(' + longPieces.join('|') + ')',
[1202] Fix | Delete
'i'
[1203] Fix | Delete
);
[1204] Fix | Delete
this._monthsShortStrictRegex = new RegExp(
[1205] Fix | Delete
'^(' + shortPieces.join('|') + ')',
[1206] Fix | Delete
'i'
[1207] Fix | Delete
);
[1208] Fix | Delete
}
[1209] Fix | Delete
[1210] Fix | Delete
// FORMATTING
[1211] Fix | Delete
[1212] Fix | Delete
addFormatToken('Y', 0, 0, function () {
[1213] Fix | Delete
var y = this.year();
[1214] Fix | Delete
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
[1215] Fix | Delete
});
[1216] Fix | Delete
[1217] Fix | Delete
addFormatToken(0, ['YY', 2], 0, function () {
[1218] Fix | Delete
return this.year() % 100;
[1219] Fix | Delete
});
[1220] Fix | Delete
[1221] Fix | Delete
addFormatToken(0, ['YYYY', 4], 0, 'year');
[1222] Fix | Delete
addFormatToken(0, ['YYYYY', 5], 0, 'year');
[1223] Fix | Delete
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
[1224] Fix | Delete
[1225] Fix | Delete
// ALIASES
[1226] Fix | Delete
[1227] Fix | Delete
addUnitAlias('year', 'y');
[1228] Fix | Delete
[1229] Fix | Delete
// PRIORITIES
[1230] Fix | Delete
[1231] Fix | Delete
addUnitPriority('year', 1);
[1232] Fix | Delete
[1233] Fix | Delete
// PARSING
[1234] Fix | Delete
[1235] Fix | Delete
addRegexToken('Y', matchSigned);
[1236] Fix | Delete
addRegexToken('YY', match1to2, match2);
[1237] Fix | Delete
addRegexToken('YYYY', match1to4, match4);
[1238] Fix | Delete
addRegexToken('YYYYY', match1to6, match6);
[1239] Fix | Delete
addRegexToken('YYYYYY', match1to6, match6);
[1240] Fix | Delete
[1241] Fix | Delete
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
[1242] Fix | Delete
addParseToken('YYYY', function (input, array) {
[1243] Fix | Delete
array[YEAR] =
[1244] Fix | Delete
input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
[1245] Fix | Delete
});
[1246] Fix | Delete
addParseToken('YY', function (input, array) {
[1247] Fix | Delete
array[YEAR] = hooks.parseTwoDigitYear(input);
[1248] Fix | Delete
});
[1249] Fix | Delete
addParseToken('Y', function (input, array) {
[1250] Fix | Delete
array[YEAR] = parseInt(input, 10);
[1251] Fix | Delete
});
[1252] Fix | Delete
[1253] Fix | Delete
// HELPERS
[1254] Fix | Delete
[1255] Fix | Delete
function daysInYear(year) {
[1256] Fix | Delete
return isLeapYear(year) ? 366 : 365;
[1257] Fix | Delete
}
[1258] Fix | Delete
[1259] Fix | Delete
// HOOKS
[1260] Fix | Delete
[1261] Fix | Delete
hooks.parseTwoDigitYear = function (input) {
[1262] Fix | Delete
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
[1263] Fix | Delete
};
[1264] Fix | Delete
[1265] Fix | Delete
// MOMENTS
[1266] Fix | Delete
[1267] Fix | Delete
var getSetYear = makeGetSet('FullYear', true);
[1268] Fix | Delete
[1269] Fix | Delete
function getIsLeapYear() {
[1270] Fix | Delete
return isLeapYear(this.year());
[1271] Fix | Delete
}
[1272] Fix | Delete
[1273] Fix | Delete
function createDate(y, m, d, h, M, s, ms) {
[1274] Fix | Delete
// can't just apply() to create a date:
[1275] Fix | Delete
// https://stackoverflow.com/q/181348
[1276] Fix | Delete
var date;
[1277] Fix | Delete
// the date constructor remaps years 0-99 to 1900-1999
[1278] Fix | Delete
if (y < 100 && y >= 0) {
[1279] Fix | Delete
// preserve leap years using a full 400 year cycle, then reset
[1280] Fix | Delete
date = new Date(y + 400, m, d, h, M, s, ms);
[1281] Fix | Delete
if (isFinite(date.getFullYear())) {
[1282] Fix | Delete
date.setFullYear(y);
[1283] Fix | Delete
}
[1284] Fix | Delete
} else {
[1285] Fix | Delete
date = new Date(y, m, d, h, M, s, ms);
[1286] Fix | Delete
}
[1287] Fix | Delete
[1288] Fix | Delete
return date;
[1289] Fix | Delete
}
[1290] Fix | Delete
[1291] Fix | Delete
function createUTCDate(y) {
[1292] Fix | Delete
var date, args;
[1293] Fix | Delete
// the Date.UTC function remaps years 0-99 to 1900-1999
[1294] Fix | Delete
if (y < 100 && y >= 0) {
[1295] Fix | Delete
args = Array.prototype.slice.call(arguments);
[1296] Fix | Delete
// preserve leap years using a full 400 year cycle, then reset
[1297] Fix | Delete
args[0] = y + 400;
[1298] Fix | Delete
date = new Date(Date.UTC.apply(null, args));
[1299] Fix | Delete
if (isFinite(date.getUTCFullYear())) {
[1300] Fix | Delete
date.setUTCFullYear(y);
[1301] Fix | Delete
}
[1302] Fix | Delete
} else {
[1303] Fix | Delete
date = new Date(Date.UTC.apply(null, arguments));
[1304] Fix | Delete
}
[1305] Fix | Delete
[1306] Fix | Delete
return date;
[1307] Fix | Delete
}
[1308] Fix | Delete
[1309] Fix | Delete
// start-of-first-week - start-of-year
[1310] Fix | Delete
function firstWeekOffset(year, dow, doy) {
[1311] Fix | Delete
var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
[1312] Fix | Delete
fwd = 7 + dow - doy,
[1313] Fix | Delete
// first-week day local weekday -- which local weekday is fwd
[1314] Fix | Delete
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
[1315] Fix | Delete
[1316] Fix | Delete
return -fwdlw + fwd - 1;
[1317] Fix | Delete
}
[1318] Fix | Delete
[1319] Fix | Delete
// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
[1320] Fix | Delete
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
[1321] Fix | Delete
var localWeekday = (7 + weekday - dow) % 7,
[1322] Fix | Delete
weekOffset = firstWeekOffset(year, dow, doy),
[1323] Fix | Delete
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
[1324] Fix | Delete
resYear,
[1325] Fix | Delete
resDayOfYear;
[1326] Fix | Delete
[1327] Fix | Delete
if (dayOfYear <= 0) {
[1328] Fix | Delete
resYear = year - 1;
[1329] Fix | Delete
resDayOfYear = daysInYear(resYear) + dayOfYear;
[1330] Fix | Delete
} else if (dayOfYear > daysInYear(year)) {
[1331] Fix | Delete
resYear = year + 1;
[1332] Fix | Delete
resDayOfYear = dayOfYear - daysInYear(year);
[1333] Fix | Delete
} else {
[1334] Fix | Delete
resYear = year;
[1335] Fix | Delete
resDayOfYear = dayOfYear;
[1336] Fix | Delete
}
[1337] Fix | Delete
[1338] Fix | Delete
return {
[1339] Fix | Delete
year: resYear,
[1340] Fix | Delete
dayOfYear: resDayOfYear,
[1341] Fix | Delete
};
[1342] Fix | Delete
}
[1343] Fix | Delete
[1344] Fix | Delete
function weekOfYear(mom, dow, doy) {
[1345] Fix | Delete
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
[1346] Fix | Delete
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
[1347] Fix | Delete
resWeek,
[1348] Fix | Delete
resYear;
[1349] Fix | Delete
[1350] Fix | Delete
if (week < 1) {
[1351] Fix | Delete
resYear = mom.year() - 1;
[1352] Fix | Delete
resWeek = week + weeksInYear(resYear, dow, doy);
[1353] Fix | Delete
} else if (week > weeksInYear(mom.year(), dow, doy)) {
[1354] Fix | Delete
resWeek = week - weeksInYear(mom.year(), dow, doy);
[1355] Fix | Delete
resYear = mom.year() + 1;
[1356] Fix | Delete
} else {
[1357] Fix | Delete
resYear = mom.year();
[1358] Fix | Delete
resWeek = week;
[1359] Fix | Delete
}
[1360] Fix | Delete
[1361] Fix | Delete
return {
[1362] Fix | Delete
week: resWeek,
[1363] Fix | Delete
year: resYear,
[1364] Fix | Delete
};
[1365] Fix | Delete
}
[1366] Fix | Delete
[1367] Fix | Delete
function weeksInYear(year, dow, doy) {
[1368] Fix | Delete
var weekOffset = firstWeekOffset(year, dow, doy),
[1369] Fix | Delete
weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
[1370] Fix | Delete
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
[1371] Fix | Delete
}
[1372] Fix | Delete
[1373] Fix | Delete
// FORMATTING
[1374] Fix | Delete
[1375] Fix | Delete
addFormatToken('w', ['ww', 2], 'wo', 'week');
[1376] Fix | Delete
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
[1377] Fix | Delete
[1378] Fix | Delete
// ALIASES
[1379] Fix | Delete
[1380] Fix | Delete
addUnitAlias('week', 'w');
[1381] Fix | Delete
addUnitAlias('isoWeek', 'W');
[1382] Fix | Delete
[1383] Fix | Delete
// PRIORITIES
[1384] Fix | Delete
[1385] Fix | Delete
addUnitPriority('week', 5);
[1386] Fix | Delete
addUnitPriority('isoWeek', 5);
[1387] Fix | Delete
[1388] Fix | Delete
// PARSING
[1389] Fix | Delete
[1390] Fix | Delete
addRegexToken('w', match1to2);
[1391] Fix | Delete
addRegexToken('ww', match1to2, match2);
[1392] Fix | Delete
addRegexToken('W', match1to2);
[1393] Fix | Delete
addRegexToken('WW', match1to2, match2);
[1394] Fix | Delete
[1395] Fix | Delete
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
[1396] Fix | Delete
input,
[1397] Fix | Delete
week,
[1398] Fix | Delete
config,
[1399] Fix | Delete
token
[1400] Fix | Delete
) {
[1401] Fix | Delete
week[token.substr(0, 1)] = toInt(input);
[1402] Fix | Delete
});
[1403] Fix | Delete
[1404] Fix | Delete
// HELPERS
[1405] Fix | Delete
[1406] Fix | Delete
// LOCALES
[1407] Fix | Delete
[1408] Fix | Delete
function localeWeek(mom) {
[1409] Fix | Delete
return weekOfYear(mom, this._week.dow, this._week.doy).week;
[1410] Fix | Delete
}
[1411] Fix | Delete
[1412] Fix | Delete
var defaultLocaleWeek = {
[1413] Fix | Delete
dow: 0, // Sunday is the first day of the week.
[1414] Fix | Delete
doy: 6, // The week that contains Jan 6th is the first week of the year.
[1415] Fix | Delete
};
[1416] Fix | Delete
[1417] Fix | Delete
function localeFirstDayOfWeek() {
[1418] Fix | Delete
return this._week.dow;
[1419] Fix | Delete
}
[1420] Fix | Delete
[1421] Fix | Delete
function localeFirstDayOfYear() {
[1422] Fix | Delete
return this._week.doy;
[1423] Fix | Delete
}
[1424] Fix | Delete
[1425] Fix | Delete
// MOMENTS
[1426] Fix | Delete
[1427] Fix | Delete
function getSetWeek(input) {
[1428] Fix | Delete
var week = this.localeData().week(this);
[1429] Fix | Delete
return input == null ? week : this.add((input - week) * 7, 'd');
[1430] Fix | Delete
}
[1431] Fix | Delete
[1432] Fix | Delete
function getSetISOWeek(input) {
[1433] Fix | Delete
var week = weekOfYear(this, 1, 4).week;
[1434] Fix | Delete
return input == null ? week : this.add((input - week) * 7, 'd');
[1435] Fix | Delete
}
[1436] Fix | Delete
[1437] Fix | Delete
// FORMATTING
[1438] Fix | Delete
[1439] Fix | Delete
addFormatToken('d', 0, 'do', 'day');
[1440] Fix | Delete
[1441] Fix | Delete
addFormatToken('dd', 0, 0, function (format) {
[1442] Fix | Delete
return this.localeData().weekdaysMin(this, format);
[1443] Fix | Delete
});
[1444] Fix | Delete
[1445] Fix | Delete
addFormatToken('ddd', 0, 0, function (format) {
[1446] Fix | Delete
return this.localeData().weekdaysShort(this, format);
[1447] Fix | Delete
});
[1448] Fix | Delete
[1449] Fix | Delete
addFormatToken('dddd', 0, 0, function (format) {
[1450] Fix | Delete
return this.localeData().weekdays(this, format);
[1451] Fix | Delete
});
[1452] Fix | Delete
[1453] Fix | Delete
addFormatToken('e', 0, 0, 'weekday');
[1454] Fix | Delete
addFormatToken('E', 0, 0, 'isoWeekday');
[1455] Fix | Delete
[1456] Fix | Delete
// ALIASES
[1457] Fix | Delete
[1458] Fix | Delete
addUnitAlias('day', 'd');
[1459] Fix | Delete
addUnitAlias('weekday', 'e');
[1460] Fix | Delete
addUnitAlias('isoWeekday', 'E');
[1461] Fix | Delete
[1462] Fix | Delete
// PRIORITY
[1463] Fix | Delete
addUnitPriority('day', 11);
[1464] Fix | Delete
addUnitPriority('weekday', 11);
[1465] Fix | Delete
addUnitPriority('isoWeekday', 11);
[1466] Fix | Delete
[1467] Fix | Delete
// PARSING
[1468] Fix | Delete
[1469] Fix | Delete
addRegexToken('d', match1to2);
[1470] Fix | Delete
addRegexToken('e', match1to2);
[1471] Fix | Delete
addRegexToken('E', match1to2);
[1472] Fix | Delete
addRegexToken('dd', function (isStrict, locale) {
[1473] Fix | Delete
return locale.weekdaysMinRegex(isStrict);
[1474] Fix | Delete
});
[1475] Fix | Delete
addRegexToken('ddd', function (isStrict, locale) {
[1476] Fix | Delete
return locale.weekdaysShortRegex(isStrict);
[1477] Fix | Delete
});
[1478] Fix | Delete
addRegexToken('dddd', function (isStrict, locale) {
[1479] Fix | Delete
return locale.weekdaysRegex(isStrict);
[1480] Fix | Delete
});
[1481] Fix | Delete
[1482] Fix | Delete
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
[1483] Fix | Delete
var weekday = config._locale.weekdaysParse(input, token, config._strict);
[1484] Fix | Delete
// if we didn't get a weekday name, mark the date as invalid
[1485] Fix | Delete
if (weekday != null) {
[1486] Fix | Delete
week.d = weekday;
[1487] Fix | Delete
} else {
[1488] Fix | Delete
getParsingFlags(config).invalidWeekday = input;
[1489] Fix | Delete
}
[1490] Fix | Delete
});
[1491] Fix | Delete
[1492] Fix | Delete
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
[1493] Fix | Delete
week[token] = toInt(input);
[1494] Fix | Delete
});
[1495] Fix | Delete
[1496] Fix | Delete
// HELPERS
[1497] Fix | Delete
[1498] Fix | Delete
function parseWeekday(input, locale) {
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function