On this example, column Reference is sorted lexicographically.
<script> /** * Convert french date interval "d/m/Y au d/m/Y" in a string which can be properly compared lexicographically * For example, converts "01/04/2017 au 05/06/2018" to "2017-04-01-2018-06-05" * @param value * @returns {string} */ function convertDateInterval(value) { var matches = value.match(/([0-9]{2}\/[0-9]{2}\/[0-9]{4}) au ([0-9]{2}\/[0-9]{2}\/[0-9]{4})/); var date1Parts = matches[1].split('/'); var date2Parts = matches[2].split('/'); return date1Parts[2] + '-' + date1Parts[1] + '-' + date1Parts[0] + '-' + date2Parts[2] + '-' + date2Parts[1] + '-' + date2Parts[0]; } //Start table fake sort jQuery('.table-fake').fakeTableSortable({ headerItems: 'div.table-fake-row-first > div', lineItems: 'div.table-fake-row', cellItems: 'div.table-fake-col', firstSort: 'asc', sortMethods: ['lexicographical', 'lexicographical', 'lexicographical', 'number'], textConverter: [null, null, convertDateInterval, null] }); </script>
On this example, column Reference is sorted by number value.
The only change from previous example is the sort method applied on the Reference column :
sortMethods: ['lexicographical', 'number', 'lexicographical', 'number']