/**
 * This sorting plug-in allows for HTML tags with date Time data. With the
 * 'html' type it will strip the HTML and then sorts by strings, with this type
 * it strips the HTML and then sorts by Dates. Note also that this sorting
 * plug-in has an equivalent type detection plug-in which can make integration
 * easier.
 *
 * DataTables 1.10+ still doesnt have this basic Date with HTML content type
 * detection mechanism ootb
 *
 * @name DateTime with HTML
 * @summary Sort data which is a mix of HTML and date time data.
 *
 *
 * @example $('#example').dataTable( { columnDefs: [ { type:
 *          'pncs-dateTime-html', targets: 0 } ] } );
 */
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
	"pncs-dateTime-html-pre" : function(a) {
		var x = String(a).replace(/<[\s\S]*?>/g, "");
		return new Date(x);
	},
	"pncs-dateTime-html-asc" : function(a, b) {
		return ((a < b) ? -1 : ((a > b) ? 1 : 0));
	},
	"pncs-dateTime-html-desc" : function(a, b) {
		return ((a < b) ? 1 : ((a > b) ? -1 : 0));
	}
});