Skip to content

Commit

Permalink
detailed dates for start/due tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
mart2070 committed May 2, 2024
1 parent 5f39cff commit 918e3f0
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

(function() {
'use strict';

/* QUEUE COLORS */

//from main webqueue script
Expand Down Expand Up @@ -214,8 +213,8 @@
}

//change date modified
let dateTypes = ['LastModifiedDate','ModifiedDate','CreatedDate','DueDate']
for (const dType of dateTypes) {
let relativeDates = ['LastModifiedDate','ModifiedDate','CreatedDate']
for (const dType of relativeDates) {
if (dType in item) {
let dTxt = item[dType].txt
let dCell = item[dType].cell
Expand All @@ -231,6 +230,23 @@
}
}

let detailedDates = ['DueDate','StartDate']
for (const dType of detailedDates) {
if (dType in item) {
let dTxt = item[dType].txt
let dCell = item[dType].cell

let date = moment(dTxt)
let dTxtNew = date.calendar()

if (dTxtNew == "Invalid date") {
console.warn("Failed date:",dTxt,item)
} else {
dCell.innerText = dTxtNew
}
}
}

//highlight modified/age red
if ('LastModifiedDate' in item) {
let modDate = item.LastModifiedDate
Expand Down

0 comments on commit 918e3f0

Please sign in to comment.