1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-30 23:52:11 +01:00

Merge branch 'master' of github.com:DataTables/DataTablesSrc

This commit is contained in:
Allan Jardine 2014-01-14 15:47:45 +00:00
parent 3bd9858e59
commit 734607635a
2 changed files with 20 additions and 11 deletions

View File

@ -1 +1 @@
23e7a8a3c3e386567adf2ea3a4e454a4ca7ff2f1
1f4688ea66aa148745212b66562aa3508ee15b98

View File

@ -104,6 +104,7 @@
var _re_new_lines = /[\r\n]/g;
var _re_html = /<.*?>/g;
var _re_formatted_numeric = /[',$£€¥%]/g;
var _re_date_start = /^[\d\+\-a-zA-Z]/;
@ -2520,11 +2521,12 @@
var tableId = settings.sTableId;
var previousSearch = settings.oPreviousSearch;
var features = settings.aanFeatures;
var input = '<input type="search" class="'+classes.sFilterInput+'"/>';
var str = settings.oLanguage.sSearch;
str = str.match(/_INPUT_/) ?
str.replace('_INPUT_', '<input type="search" />') :
str+'<input type="search" class="'+classes.sFilterInput+'"/>';
str.replace('_INPUT_', input) :
str+input;
var filter = $('<div/>', {
'id': ! features.f ? tableId+'_filter' : null,
@ -13691,19 +13693,26 @@
// Built in type detection. See model.ext.aTypes for information about
// what is required from this methods.
$.extend( DataTable.ext.type.detect, [
// Dates (only those recognised by the browser's Date.parse)
function ( d )
{
var parsed = Date.parse(d);
return (parsed !== null && !isNaN(parsed)) || _empty(d) ? 'date' : null;
},
// Plain numbers
// Plain numbers - first since V8 detects some plain numbers as dates
// e.g. Date.parse('55') (but not all, e.g. Date.parse('22')...).
function ( d )
{
return _isNumber( d ) ? 'numeric' : null;
},
// Dates (only those recognised by the browser's Date.parse)
function ( d )
{
// V8 will remove any unknown characters at the start of the expression,
// leading to false matches such as `$245.12` being a valid date. See
// forum thread 18941 for detail.
if ( d && ! _re_date_start.test(d) ) {
return null;
}
var parsed = Date.parse(d);
return (parsed !== null && !isNaN(parsed)) || _empty(d) ? 'date' : null;
},
// Formatted numbers
function ( d )
{