techgaun / active-forks

Find active github forks of a repo https://git.io/vSnrC
https://techgaun.github.io/active-forks/index.html
2.29k stars 299 forks source link

lexicographic sort on last update is misordering forks #18

Closed drjasonharrison-vp-eio closed 5 years ago

drjasonharrison-vp-eio commented 5 years ago

The lexicographic sort of last update of a fork is putting 2 years, 3 years, 4 years, ... 8 years, before 9 months. Months should come before years. "a year" needs to come before "2 years" etc.

Either the sorting rule attached to the column needs to parse the duration before making comparisons, or a hidden value should be used at the sort key.

techgaun commented 5 years ago

@drjasonharrison-vp-eio really good point. I think hidden value is a way to go here. Let me know if you wanna take a crack at this and do a PR

drjasonharrison-vp-eio commented 5 years ago

Hints: see https://datatables.net/reference/option/columns.orderData and add the hidden column to the javascript.

techgaun commented 5 years ago

@drjasonharrison-vp-eio thanks for the link. I believe I have fixed it yesterday although little differently (using columns.render). Would you mind checking once?

drjasonharrison-vp-eio commented 5 years ago

Ah, I see that it is fixed. I didn't see any references to a commit or pull request so I didn't think to check the deployment. Thanks!

techgaun commented 5 years ago

@drjasonharrison-vp-eio ya its referenced above as closed this. The commit is https://github.com/techgaun/active-forks/commit/ebe187eba55d118527c0feea492133c113570ada

drjasonharrison-vp-eio commented 5 years ago

Excellent! It definitely improves the behaviour.