Fix tables using tablesorter.js so that date columns are sorted by time#3410
Fix tables using tablesorter.js so that date columns are sorted by time#3410johannaengland merged 1 commit intoUninett:masterfrom
Conversation
johannaengland
left a comment
There was a problem hiding this comment.
I can't really say anything about the JavaScript code itself, but I tested it and it works great!
|
The fact that this has become a problem at all, is it not related to #3369? |
No, it is directly related to it. Because beforehand it did not make a difference between sorting timestamps of the format "2025-04-26 13:00:00" by their string value instead of their numeric time value. But I think this change is generally nice to have, in case the date format changes again in the future :D |
Exactly. That's one of the great advantages of ISO timestamps: They are both quite unambiguous and also easy to sort as if they were strings :-) I like this fix, though I've now also posted #3412 based on your research. |
f69feb2 to
820f508
Compare
820f508 to
b605954
Compare
|



Scope and purpose
tablesorter.js used in the thresholds threshold table and useradmin API-token table sorts date columns by their string value and not their numeric time value.
This PR makes it so that date columns are sorted by their numeric time value in these tables.
Urls:
/useradmin/tokens//threshold/This pull request
Contributor Checklist
Added/amended tests for new/changed codeAdded/changed documentationLinted/formatted the code with black and ruff, easiest by using pre-commit<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be doneIf this results in changes in the UI: Added screenshots of the before and afterIf this adds a new Python source code file: Added the boilerplate header to that file