Вход Регистрация
Файл: wapxl.ru/bower_components/datatables-plugins/sorting/monthYear.js
Строк: 36
<?php
/**
 * This sorting plug-in will sort, in calendar order, data which
 * is in the format "MM YY".
 *
 * Please note that this plug-in is **deprecated*. The
 * [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
 * functionality and flexibility.
 *
 *  @name Date (MM YY)
 *  @anchor Sort dates in the format `MM YY`
 *  @author Michael Motek
 *  @deprecated
 *
 *  @example
 *    $('#example').dataTable( {
 *       columnDefs: [
 *         { type: 'monthYear', targets: 0 }
 *       ]
 *    } );
 */

jQuery.extendjQuery.fn.dataTableExt.oSort, {
    
"monthYear-pre": function ( ) {
        var 
s.split(' ');
        
// Date uses the American "MM DD YY" format
        
return new Date(a[0]+' 01 '+a[1]);
    },

    
"monthYear-asc": function ( a) {
        return ((
b) ? -: ((b) ? 0));
    },

    
"monthYear-desc": function ( a) {
        return ((
b) ? : ((b) ?  -0));
    }
} );
?>
Онлайн: 1
Реклама