How can I sort "number | year" column?
How can I sort "number | year" column?
![ehudg](https://secure.gravatar.com/avatar/39a269859f4615112190841e15b823ae/?default=https%3A%2F%2Fvanillicon.com%2F39a269859f4615112190841e15b823ae_200.png&rating=g&size=120)
Hi
I have a column with the following format:
day_in_year | year
Example:
61 | 2018
I need a way to sort this column (like the de_date plugin), given that 99 | 2017 < 1 | 2018.
I've tested the plugins from https://datatables.net/plug-ins/sorting/, but did not found anything helpful.
Many thanks for this great tool!
This discussion has been closed.
Answers
I think you'd need your own sorting plug-in for this one. Details on how to write one are here - all you really need here is a split on the pipe and return the number you want to sort on from the
-pre
method.Allan