3 $.extend( DataTable.ext.aTypes, [
6 * Purpose: Check to see if a string is numeric
7 * Returns: string:'numeric' or null
8 * Inputs: mixed:sText - string to check
12 /* Allow zero length strings as a number */
13 if ( typeof sData === 'number' )
17 else if ( typeof sData !== 'string' )
22 var sValidFirstChars = "0123456789-";
23 var sValidChars = "0123456789.";
27 /* Check for a valid first char (no period and allow negatives) */
28 Char = sData.charAt(0);
29 if (sValidFirstChars.indexOf(Char) == -1)
34 /* Check all the other characters are valid */
35 for ( var i=1 ; i<sData.length ; i++ )
37 Char = sData.charAt(i);
38 if (sValidChars.indexOf(Char) == -1)
43 /* Only allowed one decimal place... */
59 * Purpose: Check to see if a string is actually a formatted date
60 * Returns: string:'date' or null
61 * Inputs: string:sText - string to check
65 var iParse = Date.parse(sData);
66 if ( (iParse !== null && !isNaN(iParse)) || (typeof sData === 'string' && sData.length === 0) )
75 * Purpose: Check to see if a string should be treated as an HTML string
76 * Returns: string:'html' or null
77 * Inputs: string:sText - string to check
81 if ( typeof sData === 'string' && sData.indexOf('<') != -1 && sData.indexOf('>') != -1 )