Skip to content

Commit

Permalink
HotFix: stop accidental inferring that a semantic version number is a…
Browse files Browse the repository at this point in the history
… date.
  • Loading branch information
LeeWannacott committed May 11, 2023
1 parent 35d68aa commit 82e92a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
for (let [columnIndex, th] of tableHeadHeaders.entries()) {
const regexMinutesAndSeconds = /^(\d+h)?\s?(\d+m)?\s?(\d+s)?$/i;
const regexFileSizeSort = /^([.0-9]+)\s?(B|KB|KiB|MB|MiB|GB|GiB|TB|TiB)/i;
const regexDates = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
// Doesn't infer dates with delimiter "."; as could capture semantic version numbers.
const regexDates = /^(\d\d?)[/-](\d\d?)[/-]((\d\d)?\d\d)$/;
let runtimeSortCounter = 0,
fileSizeSortCounter = 0,
datesSortCounter = 0;
Expand Down Expand Up @@ -230,9 +231,9 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
try {
for (let [i, tr] of tableRows.entries()) {
let columnOfTd;
const regexDate = /^(\d\d?)[./-](\d\d?)[./-]((\d\d)?\d\d)$/;
const regexDates = /^(\d\d?)[./-](\d\d?)[./-]((\d\d)?\d\d)$/;
columnOfTd = tr.querySelectorAll("td").item(columnIndex).textContent;
let match = columnOfTd.match(regexDate);
let match = columnOfTd.match(regexDates);
let [years, days, months] = [0, 0, 0];
let numberToSort = columnOfTd;
if (match) {
Expand Down

0 comments on commit 82e92a6

Please sign in to comment.