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 8400451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:33:47+00:00 2026-06-09T21:33:47+00:00

I am using a Jquery plugin called datatables Its fantastic, however I cannot get

  • 0

I am using a Jquery plugin called datatables

Its fantastic, however I cannot get the dates to sort correctly according to the dd/mm/yyyy format.

I have looked at their support formats but none of these fixes seem to work.

Can anybody here help me please?

  • 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-09T21:33:48+00:00Added an answer on June 9, 2026 at 9:33 pm

    Update 2020: HTML Solution

    Since HTML 5 is so much developed and almost all major browser supporting it. So now a much cleaner approach is to use HTML5 data attributes (maxx777 provided a PHP solution I am using the simple HTML). For non-numeric data as in our scenario, we can use data-sort or data-order attribute and assign a sortable value to it.

    HTML

    <td data-sort='YYYYMMDD'>DD/MM/YYYY</td>
    

    Here is working HTML solution

    jQuery Solution

    Here is working jQuery solution.

    jQuery.extend( jQuery.fn.dataTableExt.oSort, {
    "date-uk-pre": function ( a ) {
        var ukDatea = a.split('/');
        return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
    },
    
    "date-uk-asc": function ( a, b ) {
        return ((a < b) ? -1 : ((a > b) ? 1 : 0));
    },
    
    "date-uk-desc": function ( a, b ) {
        return ((a < b) ? 1 : ((a > b) ? -1 : 0));
    }
    } );
     
    

    Add the above code to script and set the specific column with Date values with { "sType": "date-uk" } and others as null, see below:

    $(document).ready(function() {
        $('#example').dataTable( {
            "aoColumns": [
                null,
                null,
                null,
                null,
                { "sType": "date-uk" },
                null
            ]
        });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery plugin called GalleryView, in its Beta3 version (http://spaceforaname.com/galleryview). The Beta4
I am using a jQuery plugin called iScroll 4 ( iScroll4 Docs ), which
I am using a jquery plugin from [ FilamentGroup ] called DateRangePicker. I have
I'm using this plugin for jquery called resize-crop: http://code.google.com/p/resize-crop/ The problem with this is
I'm using a jQuery plugin called Tablesorter to do client-side sorting of a log
I am using a jquery plugin called masonry. In IE & firefox, the site
I have been using a jquery plugin called uploadify for handling file uploads as
I am using this new jQuery plugin called jsTree www.jstree.com and using the HTML
I'm using the jQuery plugin that generates interactive tables called jqGrid . I want
I'm using the datatables JQuery plugin. I use it with AJAX and pagination (server-side).

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.