(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.momentParseformat = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 10, but first < 32 && last < 13, then it must be DD/MM format = format.replace(regexDayMonth, 'DD/MM') // check if first < 10 && last > 12, then it must be M/YY format = format.replace(regexMonthShortYearShort, 'M/YY') // check if first < 13 && last > 12, then it must be MM/YY format = format.replace(regexMonthYearShort, 'MM/YY') // to prevent 9.20 gets formated to D.Y, we format the complete date first, then go for the time if (format.match(formatIncludesMonth)) { var regexHoursDotWithLeadingZeroOrDoubleDigitMinutes = /0\d.\d{2}|\d{2}.\d{2}/ var regexHoursDotMinutes = /\d{1}.\d{2}/ format = format.replace(regexHoursDotWithLeadingZeroOrDoubleDigitMinutes, 'H.mm') format = format.replace(regexHoursDotMinutes, 'h.mm') } // now, the next number, if existing, must be a day format = format.replace(regexDayLeadingZero, 'DD') format = format.replace(regexDay, 'D') // last but not least, there could still be a year left format = format.replace(regexYearShort, 'YY') if (format.length < 1) { format = undefined } return format } // if we can't find an endian based on the separator, but // there still is a short date with day, month & year, // we try to make a smart decision to identify the order function replaceEndian (options, matchedPart, first, separator, second, third) { var parts var hasSingleDigit = Math.min(first.length, second.length, third.length) === 1 var hasQuadDigit = Math.max(first.length, second.length, third.length) === 4 var preferredOrder = typeof options.preferredOrder === 'string' ? options.preferredOrder : options.preferredOrder[separator] first = parseInt(first, 10) second = parseInt(second, 10) third = parseInt(third, 10) parts = [first, second, third] preferredOrder = preferredOrder.toUpperCase() // If first is a year, order will always be Year-Month-Day if (first > 31) { parts[0] = hasQuadDigit ? 'YYYY' : 'YY' parts[1] = hasSingleDigit ? 'M' : 'MM' parts[2] = hasSingleDigit ? 'D' : 'DD' return parts.join(separator) } // Second will never be the year. And if it is a day, // the order will always be Month-Day-Year if (second > 12) { parts[0] = hasSingleDigit ? 'M' : 'MM' parts[1] = hasSingleDigit ? 'D' : 'DD' parts[2] = hasQuadDigit ? 'YYYY' : 'YY' return parts.join(separator) } // if third is a year ... if (third > 31) { parts[2] = hasQuadDigit ? 'YYYY' : 'YY' // ... try to find day in first and second. // If found, the remaining part is the month. if (preferredOrder[0] === 'M' && first < 13) { parts[0] = hasSingleDigit ? 'M' : 'MM' parts[1] = hasSingleDigit ? 'D' : 'DD' return parts.join(separator) } parts[0] = hasSingleDigit ? 'D' : 'DD' parts[1] = hasSingleDigit ? 'M' : 'MM' return parts.join(separator) } // if we had no luck until here, we use the preferred order parts[preferredOrder.indexOf('D')] = hasSingleDigit ? 'D' : 'DD' parts[preferredOrder.indexOf('M')] = hasSingleDigit ? 'M' : 'MM' parts[preferredOrder.indexOf('Y')] = hasQuadDigit ? 'YYYY' : 'YY' return parts.join(separator) } },{}]},{},[1])(1) });