tablesorter/dist/js/parsers/parser-globalize.min.js
2015-10-27 17:01:07 -05:00

4 lines
1.0 KiB
JavaScript

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