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

  • SEARCH
  • Home
  • 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 7956293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:56:57+00:00 2026-06-04T03:56:57+00:00

The table has a couple of columns including the first column containing custom Date

  • 0

The table has a couple of columns including the first column containing custom Date format (dd-mm-yyyy HH:MM:SS)
e.g

   <tr>
        <td>14-05-2012 13:57:04</td>
        <td>MTUPTTC01V4.3_E2E-LoadBalancer-1336992891.jtl</td>
        <td>14-05-2012 13:10:03</td>
        <td>14-05-2012 13:56:38</td>
        <td>00:46:35</td>
        <td>400</td>
        <td>152328</td>
        <td>2494</td>
        <td>1.64%</td>
        <td><a href="2012-05-14_13_56_52">Results</a></td>
    </tr>

and i am using the following custom parser but it doesnt seem to work.

   $.tablesorter.addParser({
                id: 'jmeterDate',
                is: function(s) {
                        return false;
                },
                format: function(s) {
                        var date = s.match(/^(\d{2})-(\d{2})-(\d{4})[ ](\d{2}):(\d{2}):(\d{2})$/);
                        var d = date[1];
                        var m = date[2];
                        var y = date[3];
                        var H = date[4];
                        var M = date[5];
                        var S = date[6];
                        var MS = 0;
                        //return '' + y + m + d;
                        return new Date(y, m, d, H, M, S, MS).getTime();
                },
                type: 'Numeric'
        });
        $("#tablesorter-table").tablesorter({
                headers: {
                        0: {
                                sorter: 'jmeterDate'
                        }
                }
        });

See the following link for a complete example

http://jsfiddle.net/Ese5A/1/

  • 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-04T03:56:58+00:00Added an answer on June 4, 2026 at 3:56 am

    I have solved the problem, it wasn’t the jQuery or the custom tablesorter, it was actually the Table content itself. length of some of the dates was not what was expected by the regex e.g

    04-05-2012 13:7:1

    Notice the 7 and the 1, the regex below expects atleast 2 digits.

    s.match(/^(\d{2})-(\d{2})-(\d{4}) :(\d{2}):(\d{2})$/)

    FIX:

    s.match(/^(\d{1,2})-(\d{1,2})-(\d{4}) :(\d{1,2}):(\d{1,2})$/)

    It now accepts digits with length of 1 or 2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My SAMPLE table has the following five columns: sample_id (PK) (NUMBER) sampled_on (DATE) received_on
I have a table which has a couple of columns that do not have
I have a table called Products in my database. It has a couple of
Table has the following info: date |vendor|sales|percent| -------------------------- 2009-03-03| 10 |13.50| 1.30 | 2009-03-10|
My DB table has a column that can contain a very big amount of
An Orders table has a CustomerId column and an OrderId column. For certain reasons
Say a table has several subclass types. How can I see all columns from
I have a model that already has a couple dozen of columns that will
I am working on a site that has a couple columns in it and
We have a table that has a blob column along with other simple fields.

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.