{"version":3,"sources":["datetime-moment.js"],"names":["factory","define","amd","jQuery","moment","$","fn","dataTable","format","locale","types","ext","type","detect","unshift","d","replace","trim","isValid","order","parseInt","Infinity"],"mappings":"CAsBC,SAAUA,GACY,mBAAXC,QAAyBA,OAAOC,IAC1CD,OAAO,CAAC,SAAU,SAAU,kBAAmBD,GAE/CA,EAAQG,OAAQC,QAJlB,EAME,SAAUC,EAAGD,GAEfC,EAAEC,GAAGC,UAAUH,OAAS,SAAWI,EAAQC,GAC1C,IAAIC,EAAQL,EAAEC,GAAGC,UAAUI,IAAIC,KAG/BF,EAAMG,OAAOC,SAAS,SAAWC,GAYhC,OAXKA,IAECA,EAAEC,UACND,EAAIA,EAAEC,QAAQ,sBAAuB,KAItCD,EAAIV,EAAEY,KAAMF,IAIF,KAANA,GAAkB,OAANA,GAIVX,EAAQW,EAAGP,EAAQC,GAAQ,GAAOS,UAHjC,UAAUV,EAKjB,QAIFE,EAAMS,MAAO,UAAUX,EAAO,QAAW,SAAWO,GAWnD,OAVKA,IAECA,EAAEC,UACND,EAAIA,EAAEC,QAAQ,sBAAuB,KAItCD,EAAIV,EAAEY,KAAMF,IAGLX,EAAOW,EAAGP,EAAQC,GAAQ,GAAMS,UAEvCE,SAAUhB,EAAQW,EAAGP,EAAQC,GAAQ,GAAOD,OAAQ,KAAO,IAD3Da,EAAAA","file":"datetime-moment.js","sourcesContent":["/**\r\n * This plug-in for DataTables represents the ultimate option in extensibility\r\n * for sorting date / time strings correctly. It uses\r\n * [Moment.js](http://momentjs.com) to create automatic type detection and\r\n * sorting plug-ins for DataTables based on a given format. This way, DataTables\r\n * will automatically detect your temporal information and sort it correctly.\r\n *\r\n * For usage instructions, please see the DataTables blog\r\n * post that [introduces it](//datatables.net/blog/2014-12-18).\r\n *\r\n * @name Ultimate Date / Time sorting\r\n * @summary Sort date and time in any format using Moment.js\r\n * @author [Allan Jardine](//datatables.net)\r\n * @depends DataTables 1.10+, Moment.js 1.7+\r\n *\r\n * @example\r\n * $.fn.dataTable.moment( 'HH:mm MMM D, YY' );\r\n * $.fn.dataTable.moment( 'dddd, MMMM Do, YYYY' );\r\n *\r\n * $('#example').DataTable();\r\n */\r\n\r\n(function (factory) {\r\n\tif (typeof define === \"function\" && define.amd) {\r\n\t\tdefine([\"jquery\", \"moment\", \"datatables.net\"], factory);\r\n\t} else {\r\n\t\tfactory(jQuery, moment);\r\n\t}\r\n}(function ($, moment) {\r\n\r\n$.fn.dataTable.moment = function ( format, locale ) {\r\n\tvar types = $.fn.dataTable.ext.type;\r\n\r\n\t// Add type detection\r\n\ttypes.detect.unshift( function ( d ) {\r\n\t\tif ( d ) {\r\n\t\t\t// Strip HTML tags and newline characters if possible\r\n\t\t\tif ( d.replace ) {\r\n\t\t\t\td = d.replace(/(<.*?>)|(\\r?\\n|\\r)/g, '');\r\n\t\t\t}\r\n\r\n\t\t\t// Strip out surrounding white space\r\n\t\t\td = $.trim( d );\r\n\t\t}\r\n\r\n\t\t// Null and empty values are acceptable\r\n\t\tif ( d === '' || d === null ) {\r\n\t\t\treturn 'moment-'+format;\r\n\t\t}\r\n\r\n\t\treturn moment( d, format, locale, true ).isValid() ?\r\n\t\t\t'moment-'+format :\r\n\t\t\tnull;\r\n\t} );\r\n\r\n\t// Add sorting method - use an integer for the sorting\r\n\ttypes.order[ 'moment-'+format+'-pre' ] = function ( d ) {\r\n\t\tif ( d ) {\r\n\t\t\t// Strip HTML tags and newline characters if possible\r\n\t\t\tif ( d.replace ) {\r\n\t\t\t\td = d.replace(/(<.*?>)|(\\r?\\n|\\r)/g, '');\r\n\t\t\t}\r\n\r\n\t\t\t// Strip out surrounding white space\r\n\t\t\td = $.trim( d );\r\n\t\t}\r\n\t\t\r\n\t\treturn !moment(d, format, locale, true).isValid() ?\r\n\t\t\tInfinity :\r\n\t\t\tparseInt( moment( d, format, locale, true ).format( 'x' ), 10 );\r\n\t};\r\n};\r\n\r\n}));\r\n"]}