dist/ubique.js
// date from string and format string
date from string and format string
date from string and format string
function makeDateFromStringAndFormat(config) {
	        if (config._f === moment.ISO_8601) {
	            parseISO(config);
	            return;
	        }
	        config._a = [];
	        config._pf.empty = true;
	        var string = '' + config._i,
	            i, parsedInput, tokens, token, skipped,
	            stringLength = string.length,
	            totalParsedInputLength = 0;
	        tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
	        for (i = 0; i < tokens.length; i++) {
	            token = tokens[i];
	            parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
	            if (parsedInput) {
	                skipped = string.substr(0, string.indexOf(parsedInput));
	                if (skipped.length > 0) {
	                    config._pf.unusedInput.push(skipped);
	                }
	                string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
	                totalParsedInputLength += parsedInput.length;
	            }
	            if (formatTokenFunctions[token]) {
	                if (parsedInput) {
	                    config._pf.empty = false;
	                }
	                else {
	                    config._pf.unusedTokens.push(token);
	                }
	                addTimeToArrayFromToken(token, parsedInput, config);
	            }
	            else if (config._strict && !parsedInput) {
	                config._pf.unusedTokens.push(token);
	            }
	        }
	        config._pf.charsLeftOver = stringLength - totalParsedInputLength;
	        if (string.length > 0) {
	            config._pf.unusedInput.push(string);
	        }
	        if (config._pf.bigHour === true && config._a[HOUR] <= 12) {
	            config._pf.bigHour = undefined;
	        }
	        config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],
	                config._meridiem);
	        dateFromConfig(config);
	        checkOverflow(config);
	    }
function makeDateFromStringAndFormat ( config ) { if ( config . _f === moment . ISO_8601 ) { parseISO ( config ) ; return ; } config . _a = [ ] ; config . _pf . empty = true ; var string = '' + config . _i , i , parsedInput , tokens , token , skipped , stringLength = string . length , totalParsedInputLength = 0 ; tokens = expandFormat ( config . _f , config . _locale ) . match ( formattingTokens ) || [ ] ; for ( i = 0 ; i < tokens . length ; i ++ ) { token = tokens [ i ] ; parsedInput = ( string . match ( getParseRegexForToken ( token , config ) ) || [ ] ) [ 0 ] ; if ( parsedInput ) { skipped = string . substr ( 0 , string . indexOf ( parsedInput ) ) ; if ( skipped . length > 0 ) { config . _pf . unusedInput . push ( skipped ) ; } string = string . slice ( string . indexOf ( parsedInput ) + parsedInput . length ) ; totalParsedInputLength += parsedInput . length ; } if ( formatTokenFunctions [ token ] ) { if ( parsedInput ) { config . _pf . empty = false ; } else { config . _pf . unusedTokens . push ( token ) ; } addTimeToArrayFromToken ( token , parsedInput , config ) ; } else if ( config . _strict && ! parsedInput ) { config . _pf . unusedTokens . push ( token ) ; } } config . _pf . charsLeftOver = stringLength - totalParsedInputLength ; if ( string . length > 0 ) { config . _pf . unusedInput . push ( string ) ; } if ( config . _pf . bigHour === true && config . _a [ HOUR ] <= 12 ) { config . _pf . bigHour = undefined ; } config . _a [ HOUR ] = meridiemFixWrap ( config . _locale , config . _a [ HOUR ] , config . _meridiem ) ; dateFromConfig ( config ) ; checkOverflow ( config ) ; }
date from string and format string
date from string and format string
// This array is used to make a Date, either with `new Date` or `Date.UTC` // don't parse if it's not a known token // add remaining unparsed input length to the string // clear _12h flag if hour is <= 12 // handle meridiem