Add feature wrapper to Audit.

This commit is contained in:
Patrick Fic
2024-04-24 08:59:23 -07:00
parent b1d8c036e7
commit 09b5fca3b3
10 changed files with 161 additions and 85 deletions

View File

@@ -1,12 +1,11 @@
export function alphaSort(a, b) {
let A;
let B;
A = a ? a.toLowerCase() : "";
B = b ? b.toLowerCase() : "";
if (A < B)
//sort string ascending
return -1;
if (A > B) return 1;
return 0; //default return value (no sorting)
return (a ? a.toLowerCase() : "").localeCompare(b ? b.toLowerCase() : "");
}
export function dateSort(a, b) {
return new Date(a) - new Date(b);
}
export function statusSort(a, b, statusList) {
return statusList.findIndex((x) => x === a) - statusList.findIndex((x) => x === b);
}