WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] What date formats are available for accurate sorting? (2 posts)

  1. JGravesNBS
    Member
    Posted 9 months ago #

    What date formats are available for accurate sorting?

    mm/dd/yyyy works fine are there any others?

    http://wordpress.org/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    thanks for your question.

    The sorting is implemented in JavaScript, using the DataTables JavaScript library. According to its documentation, all date formats that are understood by Javascript's Date() function can be used in the table. For some example, please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
    Note that it's possible that not all of these work in all browsers. So, unless you implement a custom sorting algorithm for a specific date format, using mm/dd/yyyy might be the safest.
    (Additionally, the Extension from http://tablepress.org/extensions/datatables-sorting-plugins/ offers an algorithm that is suited for the most common European format dd/mm/yyyy.)

    Regards,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic