Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeWannacott committed May 9, 2023
1 parent 2510f80 commit 520d0b9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
};
const numberWithUnitType = /([.0-9]+)\s?(B|KB|KiB|MB|MiB|GB|GiB|TB|TiB)/i;
for (let [i, tr] of tableRows.entries()) {
let fileSizeTd = tr
.querySelectorAll("td")
.item(columnIndex).textContent;
let fileSizeTd = tr.querySelectorAll("td").item(columnIndex).innerText;
let match = fileSizeTd.match(numberWithUnitType);
if (match) {
let number = parseFloat(match[1]);
Expand All @@ -179,9 +177,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
function sortByRuntime(tableRows, columnData) {
for (let [i, tr] of tableRows.entries()) {
const regexMinutesAndSeconds = /^(\d+h)?\s?(\d+m)?\s?(\d+s)?$/i;
let columnOfTd = tr
.querySelectorAll("td")
.item(columnIndex).textContent;
let columnOfTd = tr.querySelectorAll("td").item(columnIndex).innerText;
let match = columnOfTd.match(regexMinutesAndSeconds);
let [minutesInSeconds, hours, seconds, timeinSeconds] = [0, 0, 0, 0];
if (match) {
Expand Down

0 comments on commit 520d0b9

Please sign in to comment.