jquery-src/jquery.calendars.picker.js
function(inst) {
			var allowedChars = (inst.options.multiSelect ? inst.options.multiSeparator :
				(inst.options.rangeSelect ? inst.options.rangeSeparator : ''));
			var literal = false;
			var hasNum = false;
			var dateFormat = inst.get('dateFormat');
			for (var i = 0; i < dateFormat.length; i++) {
				var ch = dateFormat.charAt(i);
				if (literal) {
					if (ch === "'" && dateFormat.charAt(i + 1) !== "'") {
						literal = false;
					}
					else {
						allowedChars += ch;
					}
				}
				else {
					switch (ch) {
						case 'd': case 'm': case 'o': case 'w':
							allowedChars += (hasNum ? '' : '0123456789'); hasNum = true; break;
						case 'y': case '@': case '!':
							allowedChars += (hasNum ? '' : '0123456789') + '-'; hasNum = true; break;
						case 'J':
							allowedChars += (hasNum ? '' : '0123456789') + '-.'; hasNum = true; break;
						case 'D': case 'M': case 'Y':
							return null; // Accept anything
						case "'":
							if (dateFormat.charAt(i + 1) === "'") {
								allowedChars += "'";
							}
							else {
								literal = true;
							}
							break;
						default:
							allowedChars += ch;
					}
				}
			}
			return allowedChars;
		}
function(inst) {
			var allowedChars = (inst.options.multiSelect ? inst.options.multiSeparator :
				(inst.options.rangeSelect ? inst.options.rangeSeparator : ''));
			var literal = false;
			var hasNum = false;
			var dateFormat = inst.get('dateFormat');
			for (var i = 0; i < dateFormat.length; i++) {
				var ch = dateFormat.charAt(i);
				if (literal) {
					if (ch === "'" && dateFormat.charAt(i + 1) !== "'") {
						literal = false;
					}
					else {
						allowedChars += ch;
					}
				}
				else {
					switch (ch) {
						case 'd': case 'm': case 'o': case 'w':
							allowedChars += (hasNum ? '' : '0123456789'); hasNum = true; break;
						case 'y': case '@': case '!':
							allowedChars += (hasNum ? '' : '0123456789') + '-'; hasNum = true; break;
						case 'J':
							allowedChars += (hasNum ? '' : '0123456789') + '-.'; hasNum = true; break;
						case 'D': case 'M': case 'Y':
							return null; // Accept anything
						case "'":
							if (dateFormat.charAt(i + 1) === "'") {
								allowedChars += "'";
							}
							else {
								literal = true;
							}
							break;
						default:
							allowedChars += ch;
					}
				}
			}
			return allowedChars;
		}
function ( inst ) { var allowedChars = ( inst . options . multiSelect ? inst . options . multiSeparator : ( inst . options . rangeSelect ? inst . options . rangeSeparator : '' ) ) ; var literal = false ; var hasNum = false ; var dateFormat = inst . get ( 'dateFormat' ) ; for ( var i = 0 ; i < dateFormat . length ; i ++ ) { var ch = dateFormat . charAt ( i ) ; if ( literal ) { if ( ch === "'" && dateFormat . charAt ( i + 1 ) !== "'" ) { literal = false ; } else { allowedChars += ch ; } } else { switch ( ch ) { case 'd' : case 'm' : case 'o' : case 'w' : allowedChars += ( hasNum ? '' : '0123456789' ) ; hasNum = true ; break ; case 'y' : case '@' : case '!' : allowedChars += ( hasNum ? '' : '0123456789' ) + '-' ; hasNum = true ; break ; case 'J' : allowedChars += ( hasNum ? '' : '0123456789' ) + '-.' ; hasNum = true ; break ; case 'D' : case 'M' : case 'Y' : return null ; // Accept anything case "'" : if ( dateFormat . charAt ( i + 1 ) === "'" ) { allowedChars += "'" ; } else { literal = true ; } break ; default : allowedChars += ch ; } } } return allowedChars ; }
Determine the set of characters allowed by the date format.
@memberof CalendarsPicker
@private
@param inst {object} The current instance settings.
@return {string} The set of allowed characters, or <code>null</code> if anything allowed.
Determine the set of characters allowed by the date format .