1/*1789981680000*/ 2/** 3 * This plug-in for DataTables represents the ultimate option in extensibility 4 * for sorting date / time strings correctly. It uses 5 * [Moment.js](http://momentjs.com) to create automatic type detection and 6 * sorting plug-ins for DataTables based on a given format. This way, DataTables 7 * will automatically detect your temporal information and sort it correctly. 8 * 9 * For usage instructions, please see the DataTables blog 10 * post that [introduces it](//datatables.net/blog/2014-12-18). 11 * 12 * @name Ultimate Date / Time sorting 13 * @summary Sort date and time in any format using Moment.js 14 * @author [Allan Jardine](//datatables.net) 15 * @depends DataTables 1.10+, Moment.js 1.7+ 16 * 17 * @example 18 * $.fn.dataTable.moment( 'HH:mm MMM D, YY' ); 19 * $.fn.dataTable.moment( 'dddd, MMMM Do, YYYY' ); 20 * 21 * $('#example').DataTable(); 22 */ 23 24(function (factory) { 25 if (typeof define === "function" && define.amd) { 26 define(["jquery", "moment", "datatables.net"], factory); 27 } else { 28 factory(jQuery, moment); 29 } 30}(function ($, moment) { 31 32$.fn.dataTable.moment = function ( format, locale ) { 33 var types = $.fn.dataTable.ext.type; 34 35 // Add type detection 36 types.detect.unshift( function ( d ) { 37 if ( d ) { 38 // Strip HTML tags and newline characters if possible 39 if ( d.replace ) { 40 d = d.replace(/(<.*?>)|(\r?\n|\r)/g, ''); 41 } 42 43 // Strip out surrounding white space 44 d = $.trim( d ); 45 } 46 47 // Null and empty values are acceptable 48 if ( d === '' || d === null ) { 49 return 'moment-'+format; 50 } 51 52 return moment( d, format, locale, true ).isValid() ? 53 'moment-'+format : 54 null; 55 } ); 56 57 // Add sorting method - use an integer for the sorting 58 types.order[ 'moment-'+format+'-pre' ] = function ( d ) { 59 if ( d ) { 60 // Strip HTML tags and newline characters if possible 61 if ( d.replace ) { 62 d = d.replace(/(<.*?>)|(\r?\n|\r)/g, ''); 63 } 64 65 // Strip out surrounding white space 66 d = $.trim( d ); 67 } 68 69 return d === '' || d === null ? 70 -Infinity : 71 parseInt( moment( d, format, locale, true ).format( 'x' ), 10 ); 72 }; 73}; 74 75}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.