Skip to content

Commit

Permalink
highlight last modified in red
Browse files Browse the repository at this point in the history
  • Loading branch information
mart2070 committed May 1, 2024
1 parent 437d493 commit b777012
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,22 @@
}
}

//highlight modified/age red
if ('LastModifiedDate' in item) {
let modDate = item.LastModifiedDate
const ageThreshold = 336

let date = moment(modDate.txt)
let duration = moment.duration(moment().diff(date))
let hours = duration.asHours()

let alpha = hours / ageThreshold

let cell = modDate.cell
cell.style.background = `rgba(255,0,0,${alpha}`
cell.classList.add(alpha > 0.5 ? "light" : "dark")
}

//find user replies & last modified by internal
if ('CustomerName' in item && 'LastModifiedByFullName' in item && 'ResponsibleFullName' in item) {
let fromUser = item.CustomerName
Expand Down

0 comments on commit b777012

Please sign in to comment.