diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 4127a5f..90a2575 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -908,6 +908,35 @@ } } + let age = ['Age'] + for (const dType of age) { + if (dType in item) { + let Age = item[dType] + const ageThreshold = 30 + + let days = Age.txt.slice(0,-1) + + if (days > 30){ + days = days - 30 + let alpha = days / ageThreshold + alpha = alpha > 1 ? 1 : alpha + let cell = Age.cell + console.log(alpha) + handleHighlight("age",alpha,cell) + cell.classList.add(alpha > 0.5 ? "light" : "dark") + } + } + } + + // let Status = ['Status'] + // for (const dType of Status) { + // if (dType in item) { + // let CurrentStatus = item[dType] + // let cell = CurrentStatus.cell + // handleHighlight("status",CurrentStatus.txt,cell) + // } + // } + //find user replies & last modified by internal if ('Requestor' in item && 'Modified By' in item && 'Prim Resp' in item) { let fromUser = item["Requestor"] @@ -1134,6 +1163,14 @@ if (type=="dateModified") { element.style.backgroundColor = `rgba(255,0,0,${txt}`; } + // if (type=="status"){ + // if (txt=="In Process") { + // element.style.backgroundColor = "red" + // } + // } + if (type=="age") { + element.style.backgroundColor = `rgba(255,0,0,${txt}`; + } } }