Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8679365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:57:12+00:00 2026-06-12T20:57:12+00:00

I am trying to use Jquery Table sorter plugin latest available. http://mottie.github.com/tablesorter/docs/#Demo The issue

  • 0

I am trying to use Jquery Table sorter plugin latest available. http://mottie.github.com/tablesorter/docs/#Demo

The issue is I have a table column with Date format and also it contains an email value. I am trying to extract the date value and sort it based on date value.

Since I am using latest version of Table sorter I tried to use the parser class name available in the latest(http://mottie.github.com/tablesorter/docs/example-parsers-class-name.html) .

Please find my fiddle below.

http://jsfiddle.net/meetravi/pztqe/8/

Code Snippet:

      <tr>
        <th>Name</th>
        <th>Major</th>
        <th>Sex</th>
        <th>English</th>
        <th>Japanese</th>
        <th>Calculus</th>
        <th>Geometry</th>
        <th class="sorter-shortDate">Date</th>
      </tr>
      <tbody>
      <tr>
        <td>Student01</td>
        <td>Languages</td>
        <td>male</td>
        <td>80</td>
        <td>70</td>
        <td>75</td>
        <td>80</td>
        <td><em>11/01/12 11:42</em><spanclass="label">xyz@xyz.com</span></td>
    </tr>
    </tbody>

<script type="text/javascript">
   $(document).ready(function(){
     $('#table-Id').tablesorter({
            theme: 'blue',
            dateFormat : "ddmmyy",
            textExtraction: {
                7: function(node, table, cellIndex) {
                    return $(node).find("em").text();
                }
            }
        });


});


</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:57:14+00:00Added an answer on June 12, 2026 at 8:57 pm

    First off, there should be a space between the span and class.

    Second, the date parser is only set up to work with 4-digit years ddmmyyyy. See this issue to get a parser that works with 2-digit years, but please read everything to see how IE behaves with 2-digit years.

    <td><em>11/01/2012 11:42</em><span class="label">xyz@xyz.com</span></td>
    

    Third, because of the content of the date column, you’ll need to set the sorter option in the header:

    headers: {
        7: { sorter: 'shortDate' }
    }
    

    And lastly, there were two textExtraction options in the demo. The second one, not the one you posted above, was overriding the function. The one you wrote works perfectly 🙂

    Here is a demo of the above mentioned changes.


    Update: Here’s an updated demo using the following parser code:

    $.tablesorter.addParser({
        id: "ddmmyy",
        is: function(s) {
            return false;
        },
        format: function(s, table, cell, cellIndex) {
            s = s
                // replace separators
                .replace(/\s+/g," ").replace(/[\-|\.|\,]/g, "/")
                // reformat dd/mm/yy to mm/dd/yy
                .replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{2})/, "$2/$1/$3");
            var d = new Date(s), y = d.getFullYear();
            // if date > 50 years old, add 100 years
            // this will work when people start using "70" and mean "2070"
            if (new Date().getFullYear() - y > 50) {
                d.setFullYear( y + 100 );
            }
            return d.getTime();
        },
        type: "numeric"
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the jQuery CSV plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV According
I'm trying to use the tablersorter jQuery plugin (www.tablesorter.com), but I can't get it
I am trying use the jQuery table sorter plugin for a table that is
I'm trying to use jquery validate. Following the example: http://docs.jquery.com/Plugins/Validation works great and I'd
In this JSFiddle http://jsfiddle.net/littlesandra88/mzPxN/ am I trying to use the tablesorter plugin to sort
I am trying to use quickSearch from http://lomalogue.com/jquery/quicksearch/ website. I don't know how to
I'm trying to use jQuery to append a row to a table and to
I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking
I'm trying to use jquery to clone a table row everytime someone presses the
I am trying to use jQuery to pick an item in a table row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.