asik
asik

Reputation: 209

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...

Upvotes: 8

Views: 11393

Answers (1)

dm4web
dm4web

Reputation: 4652

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}

Upvotes: 17

Related Questions