nette / tracy

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
https://tracy.nette.org
Other
1.75k stars 218 forks source link

Sort with natural sort instead. #547

Closed n0nag0n closed 2 years ago

n0nag0n commented 2 years ago

We noticed when using the table sort that it would sort things alphabetically instead of numerically (if the field happened to start with a number). This fixes it while maintaining alphabetical sorting.

The problem we were running into is that we would have errors in our project sort like the following:

It is the same for measuring database query times, etc. Anything numeric with text in it, it would kinda choke. Adding these couple extra arguments to the localeCompare() function allows it to sort numerics properly while maintaining alphabetical sorting.

BTW, looked for unit tests for your js stuff, but didn't find anything :grimacing: