tablesorter/dist/js/parsers/parser-globalize.min.js
Rob Garrison 7f082fa019 v2.28.10
2017-05-16 15:33:15 -05:00

4 lines
1.1 KiB
JavaScript

/*! Parser: jQuery Globalize - updated 11/2/2015 (v2.24.1) */
!function(e){"use strict";/*! jQuery Globalize date parser (https://github.com/jquery/globalize#date-module) */
e.tablesorter.addParser({id:"globalize-date",is:function(){return!1},format:function(e,l,a,o){var r,i,t=l.config,n=t.globalize&&(t.globalize[o]||t.globalize)||{};return Globalize&&(r="object"==typeof n.Globalize?n.Globalize:Globalize(n.lang||"en"),n.Globalize||(n.Globalize=r)),i=r&&r.dateParser?r.dateParser(n)(e):e?new Date(e):e,i instanceof Date&&isFinite(i)?i.getTime():e},type:"numeric"}),/*! jQuery Globalize number parser (https://github.com/jquery/globalize#number-module) */
e.tablesorter.addParser({id:"globalize-number",is:function(){return!1},format:function(l,a,o,r){var i,t,n=a.config,b=n.globalize&&(n.globalize[r]||n.globalize)||{};return Globalize&&(i="object"==typeof b.Globalize?b.Globalize:Globalize(b.lang||"en"),b.Globalize||(b.Globalize=i)),t=i&&i.numberParser?i.numberParser(b)(l):l?e.tablesorter.formatFloat((l||"").replace(/[^\w,. \-()]/g,""),a):l,l&&"number"==typeof t?t:l},type:"numeric"})}(jQuery);