PageSourceSearch

https://georgiactsa.org/_includes/js/datetime-moment.js

js georgiactsa.org collected 2026-10-01 13:06:32 UTC 2,500 bytes, 78 lines download raw bytes

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

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.