SAV.com domain list sort by date

This is a UserScript. sav.com is one of the cheapest domain registrar. But the interface is awful. You cannot sort domains by expiration date. My script lists domains on 1 page. When you click on Expiration column, it sorts domains by date.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        SAV.com domain list sort by date
// @namespace   https://github.com/borayeris/sav.com-domain-list-sort-by-date
// @match       *://*.sav.com/*/domain_list
// @grant       none
// @version     1.0
// @author      Boray Eris
// @description This is a UserScript. sav.com is one of the cheapest domain registrar. But the interface is awful. You cannot sort domains by expiration date. My script lists domains on 1 page. When you click on Expiration column, it sorts domains by date.
// 12/26/2020, 11:38:01 PM
// ==/UserScript==
$(function(){
    let $domainDetails = $('.domain-details'); // GET TABLE OF DOMAIN LIST

    /**
     * CHECK ALL PAGES
     */
    $('.pagination .auction-pagination-link:not([rel="next"])').each(function(){
        let pageNum = $(this).text();
        console.log( '//www.sav.com/domains/domain_list/'+ pageNum );
        $.get( '//www.sav.com/domains/domain_list/'+ pageNum, function( data ) {
            $domainDetails.find('tbody').append( $(data).find( '.domain-details tbody tr' ) );
        })
        .done(function(){
            $('.pagination').hide();

            /**
             * ATTACH UNIX TIME TO LINE (TD)
             */

            //console.log( $domainDetails.find('tbody tr') );
            $domainDetails.find('tbody tr td:nth-child(2)').each(function(){

                let unixTime = Date.parse( $(this).text() ) / 1000;
                $(this).parent().attr({ 'data-unixtime': unixTime });
                //console.log( unixTime );

            });

            /**
             * SORT BY CLICK
             */
            $domainDetails.find('tbody tr').on( 'click', 'td:nth-child(2)', function(){

                let $lines = $domainDetails.find('tbody tr').sort( (a, b) => { return $(a).attr('data-unixtime') - $(b).attr('data-unixtime'); } );
                $domainDetails.find('tbody').html( $lines );


            });


        });

    });

});