Edit File by line
/home/barbar84/www/wp-inclu.../js/dist/vendor
File: moment.js
config._d = createUTCDate.apply(null, config._a);
[2500] Fix | Delete
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
[2501] Fix | Delete
[2502] Fix | Delete
getParsingFlags(config).rfc2822 = true;
[2503] Fix | Delete
} else {
[2504] Fix | Delete
config._isValid = false;
[2505] Fix | Delete
}
[2506] Fix | Delete
}
[2507] Fix | Delete
[2508] Fix | Delete
// date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
[2509] Fix | Delete
function configFromString(config) {
[2510] Fix | Delete
var matched = aspNetJsonRegex.exec(config._i);
[2511] Fix | Delete
if (matched !== null) {
[2512] Fix | Delete
config._d = new Date(+matched[1]);
[2513] Fix | Delete
return;
[2514] Fix | Delete
}
[2515] Fix | Delete
[2516] Fix | Delete
configFromISO(config);
[2517] Fix | Delete
if (config._isValid === false) {
[2518] Fix | Delete
delete config._isValid;
[2519] Fix | Delete
} else {
[2520] Fix | Delete
return;
[2521] Fix | Delete
}
[2522] Fix | Delete
[2523] Fix | Delete
configFromRFC2822(config);
[2524] Fix | Delete
if (config._isValid === false) {
[2525] Fix | Delete
delete config._isValid;
[2526] Fix | Delete
} else {
[2527] Fix | Delete
return;
[2528] Fix | Delete
}
[2529] Fix | Delete
[2530] Fix | Delete
if (config._strict) {
[2531] Fix | Delete
config._isValid = false;
[2532] Fix | Delete
} else {
[2533] Fix | Delete
// Final attempt, use Input Fallback
[2534] Fix | Delete
hooks.createFromInputFallback(config);
[2535] Fix | Delete
}
[2536] Fix | Delete
}
[2537] Fix | Delete
[2538] Fix | Delete
hooks.createFromInputFallback = deprecate(
[2539] Fix | Delete
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
[2540] Fix | Delete
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
[2541] Fix | Delete
'discouraged and will be removed in an upcoming major release. Please refer to ' +
[2542] Fix | Delete
'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
[2543] Fix | Delete
function (config) {
[2544] Fix | Delete
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
[2545] Fix | Delete
}
[2546] Fix | Delete
);
[2547] Fix | Delete
[2548] Fix | Delete
// Pick the first defined of two or three arguments.
[2549] Fix | Delete
function defaults(a, b, c) {
[2550] Fix | Delete
if (a != null) {
[2551] Fix | Delete
return a;
[2552] Fix | Delete
}
[2553] Fix | Delete
if (b != null) {
[2554] Fix | Delete
return b;
[2555] Fix | Delete
}
[2556] Fix | Delete
return c;
[2557] Fix | Delete
}
[2558] Fix | Delete
[2559] Fix | Delete
function currentDateArray(config) {
[2560] Fix | Delete
// hooks is actually the exported moment object
[2561] Fix | Delete
var nowValue = new Date(hooks.now());
[2562] Fix | Delete
if (config._useUTC) {
[2563] Fix | Delete
return [
[2564] Fix | Delete
nowValue.getUTCFullYear(),
[2565] Fix | Delete
nowValue.getUTCMonth(),
[2566] Fix | Delete
nowValue.getUTCDate(),
[2567] Fix | Delete
];
[2568] Fix | Delete
}
[2569] Fix | Delete
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
[2570] Fix | Delete
}
[2571] Fix | Delete
[2572] Fix | Delete
// convert an array to a date.
[2573] Fix | Delete
// the array should mirror the parameters below
[2574] Fix | Delete
// note: all values past the year are optional and will default to the lowest possible value.
[2575] Fix | Delete
// [year, month, day , hour, minute, second, millisecond]
[2576] Fix | Delete
function configFromArray(config) {
[2577] Fix | Delete
var i,
[2578] Fix | Delete
date,
[2579] Fix | Delete
input = [],
[2580] Fix | Delete
currentDate,
[2581] Fix | Delete
expectedWeekday,
[2582] Fix | Delete
yearToUse;
[2583] Fix | Delete
[2584] Fix | Delete
if (config._d) {
[2585] Fix | Delete
return;
[2586] Fix | Delete
}
[2587] Fix | Delete
[2588] Fix | Delete
currentDate = currentDateArray(config);
[2589] Fix | Delete
[2590] Fix | Delete
//compute day of the year from weeks and weekdays
[2591] Fix | Delete
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
[2592] Fix | Delete
dayOfYearFromWeekInfo(config);
[2593] Fix | Delete
}
[2594] Fix | Delete
[2595] Fix | Delete
//if the day of the year is set, figure out what it is
[2596] Fix | Delete
if (config._dayOfYear != null) {
[2597] Fix | Delete
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
[2598] Fix | Delete
[2599] Fix | Delete
if (
[2600] Fix | Delete
config._dayOfYear > daysInYear(yearToUse) ||
[2601] Fix | Delete
config._dayOfYear === 0
[2602] Fix | Delete
) {
[2603] Fix | Delete
getParsingFlags(config)._overflowDayOfYear = true;
[2604] Fix | Delete
}
[2605] Fix | Delete
[2606] Fix | Delete
date = createUTCDate(yearToUse, 0, config._dayOfYear);
[2607] Fix | Delete
config._a[MONTH] = date.getUTCMonth();
[2608] Fix | Delete
config._a[DATE] = date.getUTCDate();
[2609] Fix | Delete
}
[2610] Fix | Delete
[2611] Fix | Delete
// Default to current date.
[2612] Fix | Delete
// * if no year, month, day of month are given, default to today
[2613] Fix | Delete
// * if day of month is given, default month and year
[2614] Fix | Delete
// * if month is given, default only year
[2615] Fix | Delete
// * if year is given, don't default anything
[2616] Fix | Delete
for (i = 0; i < 3 && config._a[i] == null; ++i) {
[2617] Fix | Delete
config._a[i] = input[i] = currentDate[i];
[2618] Fix | Delete
}
[2619] Fix | Delete
[2620] Fix | Delete
// Zero out whatever was not defaulted, including time
[2621] Fix | Delete
for (; i < 7; i++) {
[2622] Fix | Delete
config._a[i] = input[i] =
[2623] Fix | Delete
config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
[2624] Fix | Delete
}
[2625] Fix | Delete
[2626] Fix | Delete
// Check for 24:00:00.000
[2627] Fix | Delete
if (
[2628] Fix | Delete
config._a[HOUR] === 24 &&
[2629] Fix | Delete
config._a[MINUTE] === 0 &&
[2630] Fix | Delete
config._a[SECOND] === 0 &&
[2631] Fix | Delete
config._a[MILLISECOND] === 0
[2632] Fix | Delete
) {
[2633] Fix | Delete
config._nextDay = true;
[2634] Fix | Delete
config._a[HOUR] = 0;
[2635] Fix | Delete
}
[2636] Fix | Delete
[2637] Fix | Delete
config._d = (config._useUTC ? createUTCDate : createDate).apply(
[2638] Fix | Delete
null,
[2639] Fix | Delete
input
[2640] Fix | Delete
);
[2641] Fix | Delete
expectedWeekday = config._useUTC
[2642] Fix | Delete
? config._d.getUTCDay()
[2643] Fix | Delete
: config._d.getDay();
[2644] Fix | Delete
[2645] Fix | Delete
// Apply timezone offset from input. The actual utcOffset can be changed
[2646] Fix | Delete
// with parseZone.
[2647] Fix | Delete
if (config._tzm != null) {
[2648] Fix | Delete
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
[2649] Fix | Delete
}
[2650] Fix | Delete
[2651] Fix | Delete
if (config._nextDay) {
[2652] Fix | Delete
config._a[HOUR] = 24;
[2653] Fix | Delete
}
[2654] Fix | Delete
[2655] Fix | Delete
// check for mismatching day of week
[2656] Fix | Delete
if (
[2657] Fix | Delete
config._w &&
[2658] Fix | Delete
typeof config._w.d !== 'undefined' &&
[2659] Fix | Delete
config._w.d !== expectedWeekday
[2660] Fix | Delete
) {
[2661] Fix | Delete
getParsingFlags(config).weekdayMismatch = true;
[2662] Fix | Delete
}
[2663] Fix | Delete
}
[2664] Fix | Delete
[2665] Fix | Delete
function dayOfYearFromWeekInfo(config) {
[2666] Fix | Delete
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
[2667] Fix | Delete
[2668] Fix | Delete
w = config._w;
[2669] Fix | Delete
if (w.GG != null || w.W != null || w.E != null) {
[2670] Fix | Delete
dow = 1;
[2671] Fix | Delete
doy = 4;
[2672] Fix | Delete
[2673] Fix | Delete
// TODO: We need to take the current isoWeekYear, but that depends on
[2674] Fix | Delete
// how we interpret now (local, utc, fixed offset). So create
[2675] Fix | Delete
// a now version of current config (take local/utc/offset flags, and
[2676] Fix | Delete
// create now).
[2677] Fix | Delete
weekYear = defaults(
[2678] Fix | Delete
w.GG,
[2679] Fix | Delete
config._a[YEAR],
[2680] Fix | Delete
weekOfYear(createLocal(), 1, 4).year
[2681] Fix | Delete
);
[2682] Fix | Delete
week = defaults(w.W, 1);
[2683] Fix | Delete
weekday = defaults(w.E, 1);
[2684] Fix | Delete
if (weekday < 1 || weekday > 7) {
[2685] Fix | Delete
weekdayOverflow = true;
[2686] Fix | Delete
}
[2687] Fix | Delete
} else {
[2688] Fix | Delete
dow = config._locale._week.dow;
[2689] Fix | Delete
doy = config._locale._week.doy;
[2690] Fix | Delete
[2691] Fix | Delete
curWeek = weekOfYear(createLocal(), dow, doy);
[2692] Fix | Delete
[2693] Fix | Delete
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
[2694] Fix | Delete
[2695] Fix | Delete
// Default to current week.
[2696] Fix | Delete
week = defaults(w.w, curWeek.week);
[2697] Fix | Delete
[2698] Fix | Delete
if (w.d != null) {
[2699] Fix | Delete
// weekday -- low day numbers are considered next week
[2700] Fix | Delete
weekday = w.d;
[2701] Fix | Delete
if (weekday < 0 || weekday > 6) {
[2702] Fix | Delete
weekdayOverflow = true;
[2703] Fix | Delete
}
[2704] Fix | Delete
} else if (w.e != null) {
[2705] Fix | Delete
// local weekday -- counting starts from beginning of week
[2706] Fix | Delete
weekday = w.e + dow;
[2707] Fix | Delete
if (w.e < 0 || w.e > 6) {
[2708] Fix | Delete
weekdayOverflow = true;
[2709] Fix | Delete
}
[2710] Fix | Delete
} else {
[2711] Fix | Delete
// default to beginning of week
[2712] Fix | Delete
weekday = dow;
[2713] Fix | Delete
}
[2714] Fix | Delete
}
[2715] Fix | Delete
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
[2716] Fix | Delete
getParsingFlags(config)._overflowWeeks = true;
[2717] Fix | Delete
} else if (weekdayOverflow != null) {
[2718] Fix | Delete
getParsingFlags(config)._overflowWeekday = true;
[2719] Fix | Delete
} else {
[2720] Fix | Delete
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
[2721] Fix | Delete
config._a[YEAR] = temp.year;
[2722] Fix | Delete
config._dayOfYear = temp.dayOfYear;
[2723] Fix | Delete
}
[2724] Fix | Delete
}
[2725] Fix | Delete
[2726] Fix | Delete
// constant that refers to the ISO standard
[2727] Fix | Delete
hooks.ISO_8601 = function () {};
[2728] Fix | Delete
[2729] Fix | Delete
// constant that refers to the RFC 2822 form
[2730] Fix | Delete
hooks.RFC_2822 = function () {};
[2731] Fix | Delete
[2732] Fix | Delete
// date from string and format string
[2733] Fix | Delete
function configFromStringAndFormat(config) {
[2734] Fix | Delete
// TODO: Move this to another part of the creation flow to prevent circular deps
[2735] Fix | Delete
if (config._f === hooks.ISO_8601) {
[2736] Fix | Delete
configFromISO(config);
[2737] Fix | Delete
return;
[2738] Fix | Delete
}
[2739] Fix | Delete
if (config._f === hooks.RFC_2822) {
[2740] Fix | Delete
configFromRFC2822(config);
[2741] Fix | Delete
return;
[2742] Fix | Delete
}
[2743] Fix | Delete
config._a = [];
[2744] Fix | Delete
getParsingFlags(config).empty = true;
[2745] Fix | Delete
[2746] Fix | Delete
// This array is used to make a Date, either with `new Date` or `Date.UTC`
[2747] Fix | Delete
var string = '' + config._i,
[2748] Fix | Delete
i,
[2749] Fix | Delete
parsedInput,
[2750] Fix | Delete
tokens,
[2751] Fix | Delete
token,
[2752] Fix | Delete
skipped,
[2753] Fix | Delete
stringLength = string.length,
[2754] Fix | Delete
totalParsedInputLength = 0,
[2755] Fix | Delete
era;
[2756] Fix | Delete
[2757] Fix | Delete
tokens =
[2758] Fix | Delete
expandFormat(config._f, config._locale).match(formattingTokens) || [];
[2759] Fix | Delete
[2760] Fix | Delete
for (i = 0; i < tokens.length; i++) {
[2761] Fix | Delete
token = tokens[i];
[2762] Fix | Delete
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
[2763] Fix | Delete
[])[0];
[2764] Fix | Delete
if (parsedInput) {
[2765] Fix | Delete
skipped = string.substr(0, string.indexOf(parsedInput));
[2766] Fix | Delete
if (skipped.length > 0) {
[2767] Fix | Delete
getParsingFlags(config).unusedInput.push(skipped);
[2768] Fix | Delete
}
[2769] Fix | Delete
string = string.slice(
[2770] Fix | Delete
string.indexOf(parsedInput) + parsedInput.length
[2771] Fix | Delete
);
[2772] Fix | Delete
totalParsedInputLength += parsedInput.length;
[2773] Fix | Delete
}
[2774] Fix | Delete
// don't parse if it's not a known token
[2775] Fix | Delete
if (formatTokenFunctions[token]) {
[2776] Fix | Delete
if (parsedInput) {
[2777] Fix | Delete
getParsingFlags(config).empty = false;
[2778] Fix | Delete
} else {
[2779] Fix | Delete
getParsingFlags(config).unusedTokens.push(token);
[2780] Fix | Delete
}
[2781] Fix | Delete
addTimeToArrayFromToken(token, parsedInput, config);
[2782] Fix | Delete
} else if (config._strict && !parsedInput) {
[2783] Fix | Delete
getParsingFlags(config).unusedTokens.push(token);
[2784] Fix | Delete
}
[2785] Fix | Delete
}
[2786] Fix | Delete
[2787] Fix | Delete
// add remaining unparsed input length to the string
[2788] Fix | Delete
getParsingFlags(config).charsLeftOver =
[2789] Fix | Delete
stringLength - totalParsedInputLength;
[2790] Fix | Delete
if (string.length > 0) {
[2791] Fix | Delete
getParsingFlags(config).unusedInput.push(string);
[2792] Fix | Delete
}
[2793] Fix | Delete
[2794] Fix | Delete
// clear _12h flag if hour is <= 12
[2795] Fix | Delete
if (
[2796] Fix | Delete
config._a[HOUR] <= 12 &&
[2797] Fix | Delete
getParsingFlags(config).bigHour === true &&
[2798] Fix | Delete
config._a[HOUR] > 0
[2799] Fix | Delete
) {
[2800] Fix | Delete
getParsingFlags(config).bigHour = undefined;
[2801] Fix | Delete
}
[2802] Fix | Delete
[2803] Fix | Delete
getParsingFlags(config).parsedDateParts = config._a.slice(0);
[2804] Fix | Delete
getParsingFlags(config).meridiem = config._meridiem;
[2805] Fix | Delete
// handle meridiem
[2806] Fix | Delete
config._a[HOUR] = meridiemFixWrap(
[2807] Fix | Delete
config._locale,
[2808] Fix | Delete
config._a[HOUR],
[2809] Fix | Delete
config._meridiem
[2810] Fix | Delete
);
[2811] Fix | Delete
[2812] Fix | Delete
// handle era
[2813] Fix | Delete
era = getParsingFlags(config).era;
[2814] Fix | Delete
if (era !== null) {
[2815] Fix | Delete
config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
[2816] Fix | Delete
}
[2817] Fix | Delete
[2818] Fix | Delete
configFromArray(config);
[2819] Fix | Delete
checkOverflow(config);
[2820] Fix | Delete
}
[2821] Fix | Delete
[2822] Fix | Delete
function meridiemFixWrap(locale, hour, meridiem) {
[2823] Fix | Delete
var isPm;
[2824] Fix | Delete
[2825] Fix | Delete
if (meridiem == null) {
[2826] Fix | Delete
// nothing to do
[2827] Fix | Delete
return hour;
[2828] Fix | Delete
}
[2829] Fix | Delete
if (locale.meridiemHour != null) {
[2830] Fix | Delete
return locale.meridiemHour(hour, meridiem);
[2831] Fix | Delete
} else if (locale.isPM != null) {
[2832] Fix | Delete
// Fallback
[2833] Fix | Delete
isPm = locale.isPM(meridiem);
[2834] Fix | Delete
if (isPm && hour < 12) {
[2835] Fix | Delete
hour += 12;
[2836] Fix | Delete
}
[2837] Fix | Delete
if (!isPm && hour === 12) {
[2838] Fix | Delete
hour = 0;
[2839] Fix | Delete
}
[2840] Fix | Delete
return hour;
[2841] Fix | Delete
} else {
[2842] Fix | Delete
// this is not supposed to happen
[2843] Fix | Delete
return hour;
[2844] Fix | Delete
}
[2845] Fix | Delete
}
[2846] Fix | Delete
[2847] Fix | Delete
// date from string and array of format strings
[2848] Fix | Delete
function configFromStringAndArray(config) {
[2849] Fix | Delete
var tempConfig,
[2850] Fix | Delete
bestMoment,
[2851] Fix | Delete
scoreToBeat,
[2852] Fix | Delete
i,
[2853] Fix | Delete
currentScore,
[2854] Fix | Delete
validFormatFound,
[2855] Fix | Delete
bestFormatIsValid = false;
[2856] Fix | Delete
[2857] Fix | Delete
if (config._f.length === 0) {
[2858] Fix | Delete
getParsingFlags(config).invalidFormat = true;
[2859] Fix | Delete
config._d = new Date(NaN);
[2860] Fix | Delete
return;
[2861] Fix | Delete
}
[2862] Fix | Delete
[2863] Fix | Delete
for (i = 0; i < config._f.length; i++) {
[2864] Fix | Delete
currentScore = 0;
[2865] Fix | Delete
validFormatFound = false;
[2866] Fix | Delete
tempConfig = copyConfig({}, config);
[2867] Fix | Delete
if (config._useUTC != null) {
[2868] Fix | Delete
tempConfig._useUTC = config._useUTC;
[2869] Fix | Delete
}
[2870] Fix | Delete
tempConfig._f = config._f[i];
[2871] Fix | Delete
configFromStringAndFormat(tempConfig);
[2872] Fix | Delete
[2873] Fix | Delete
if (isValid(tempConfig)) {
[2874] Fix | Delete
validFormatFound = true;
[2875] Fix | Delete
}
[2876] Fix | Delete
[2877] Fix | Delete
// if there is any input that was not parsed add a penalty for that format
[2878] Fix | Delete
currentScore += getParsingFlags(tempConfig).charsLeftOver;
[2879] Fix | Delete
[2880] Fix | Delete
//or tokens
[2881] Fix | Delete
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
[2882] Fix | Delete
[2883] Fix | Delete
getParsingFlags(tempConfig).score = currentScore;
[2884] Fix | Delete
[2885] Fix | Delete
if (!bestFormatIsValid) {
[2886] Fix | Delete
if (
[2887] Fix | Delete
scoreToBeat == null ||
[2888] Fix | Delete
currentScore < scoreToBeat ||
[2889] Fix | Delete
validFormatFound
[2890] Fix | Delete
) {
[2891] Fix | Delete
scoreToBeat = currentScore;
[2892] Fix | Delete
bestMoment = tempConfig;
[2893] Fix | Delete
if (validFormatFound) {
[2894] Fix | Delete
bestFormatIsValid = true;
[2895] Fix | Delete
}
[2896] Fix | Delete
}
[2897] Fix | Delete
} else {
[2898] Fix | Delete
if (currentScore < scoreToBeat) {
[2899] Fix | Delete
scoreToBeat = currentScore;
[2900] Fix | Delete
bestMoment = tempConfig;
[2901] Fix | Delete
}
[2902] Fix | Delete
}
[2903] Fix | Delete
}
[2904] Fix | Delete
[2905] Fix | Delete
extend(config, bestMoment || tempConfig);
[2906] Fix | Delete
}
[2907] Fix | Delete
[2908] Fix | Delete
function configFromObject(config) {
[2909] Fix | Delete
if (config._d) {
[2910] Fix | Delete
return;
[2911] Fix | Delete
}
[2912] Fix | Delete
[2913] Fix | Delete
var i = normalizeObjectUnits(config._i),
[2914] Fix | Delete
dayOrDate = i.day === undefined ? i.date : i.day;
[2915] Fix | Delete
config._a = map(
[2916] Fix | Delete
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
[2917] Fix | Delete
function (obj) {
[2918] Fix | Delete
return obj && parseInt(obj, 10);
[2919] Fix | Delete
}
[2920] Fix | Delete
);
[2921] Fix | Delete
[2922] Fix | Delete
configFromArray(config);
[2923] Fix | Delete
}
[2924] Fix | Delete
[2925] Fix | Delete
function createFromConfig(config) {
[2926] Fix | Delete
var res = new Moment(checkOverflow(prepareConfig(config)));
[2927] Fix | Delete
if (res._nextDay) {
[2928] Fix | Delete
// Adding is smart enough around DST
[2929] Fix | Delete
res.add(1, 'd');
[2930] Fix | Delete
res._nextDay = undefined;
[2931] Fix | Delete
}
[2932] Fix | Delete
[2933] Fix | Delete
return res;
[2934] Fix | Delete
}
[2935] Fix | Delete
[2936] Fix | Delete
function prepareConfig(config) {
[2937] Fix | Delete
var input = config._i,
[2938] Fix | Delete
format = config._f;
[2939] Fix | Delete
[2940] Fix | Delete
config._locale = config._locale || getLocale(config._l);
[2941] Fix | Delete
[2942] Fix | Delete
if (input === null || (format === undefined && input === '')) {
[2943] Fix | Delete
return createInvalid({ nullInput: true });
[2944] Fix | Delete
}
[2945] Fix | Delete
[2946] Fix | Delete
if (typeof input === 'string') {
[2947] Fix | Delete
config._i = input = config._locale.preparse(input);
[2948] Fix | Delete
}
[2949] Fix | Delete
[2950] Fix | Delete
if (isMoment(input)) {
[2951] Fix | Delete
return new Moment(checkOverflow(input));
[2952] Fix | Delete
} else if (isDate(input)) {
[2953] Fix | Delete
config._d = input;
[2954] Fix | Delete
} else if (isArray(format)) {
[2955] Fix | Delete
configFromStringAndArray(config);
[2956] Fix | Delete
} else if (format) {
[2957] Fix | Delete
configFromStringAndFormat(config);
[2958] Fix | Delete
} else {
[2959] Fix | Delete
configFromInput(config);
[2960] Fix | Delete
}
[2961] Fix | Delete
[2962] Fix | Delete
if (!isValid(config)) {
[2963] Fix | Delete
config._d = null;
[2964] Fix | Delete
}
[2965] Fix | Delete
[2966] Fix | Delete
return config;
[2967] Fix | Delete
}
[2968] Fix | Delete
[2969] Fix | Delete
function configFromInput(config) {
[2970] Fix | Delete
var input = config._i;
[2971] Fix | Delete
if (isUndefined(input)) {
[2972] Fix | Delete
config._d = new Date(hooks.now());
[2973] Fix | Delete
} else if (isDate(input)) {
[2974] Fix | Delete
config._d = new Date(input.valueOf());
[2975] Fix | Delete
} else if (typeof input === 'string') {
[2976] Fix | Delete
configFromString(config);
[2977] Fix | Delete
} else if (isArray(input)) {
[2978] Fix | Delete
config._a = map(input.slice(0), function (obj) {
[2979] Fix | Delete
return parseInt(obj, 10);
[2980] Fix | Delete
});
[2981] Fix | Delete
configFromArray(config);
[2982] Fix | Delete
} else if (isObject(input)) {
[2983] Fix | Delete
configFromObject(config);
[2984] Fix | Delete
} else if (isNumber(input)) {
[2985] Fix | Delete
// from milliseconds
[2986] Fix | Delete
config._d = new Date(input);
[2987] Fix | Delete
} else {
[2988] Fix | Delete
hooks.createFromInputFallback(config);
[2989] Fix | Delete
}
[2990] Fix | Delete
}
[2991] Fix | Delete
[2992] Fix | Delete
function createLocalOrUTC(input, format, locale, strict, isUTC) {
[2993] Fix | Delete
var c = {};
[2994] Fix | Delete
[2995] Fix | Delete
if (format === true || format === false) {
[2996] Fix | Delete
strict = format;
[2997] Fix | Delete
format = undefined;
[2998] Fix | Delete
}
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function