Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sort date format d/m/y on bootstrap datatables plugin?

I am using this bootstrap data-tables responsive plugin. Everything is fine, but this plugin can't sort the column with date (dd/mm/YYYY) format. The plugin only can sort with YYYY/mm/dd format. So, how can I sort the dd/mm/YYYY date format with this plugin?

By the way, I am found the plugin code from the datatables.net that allow to sort the dd/mm/YYYY format.

Can someone help me to combine (may be) the original plugin and the add on code above? Thanks...

like image 943
asik Avatar asked Nov 11 '14 10:11

asik


1 Answers

in td tag add a hidden span tag with date in format YYYY/mm/dd.

HTML:

<td><span class="hidden">YYYY/mm/dd</span>dd/mm/YYYY</td>

CSS:

.hidden{display:none}
like image 190
dm4web Avatar answered Sep 20 '22 06:09

dm4web