Date Math Formating

How did you guys do the pop-up over a date in the related panel? I don’t mean the css part. I’m trying to use days to date as a varible but am having a hard time trying to put together the right format when combined with last edited, days since created (or do you use assigned) The results i’m trying to achieve are since created, since last edited, and remaining until due/end. I’ve discovered that I can paste a formula so i need only create this once and perhaps put it in a template or more likely a script. When you have time I would really appreciate the help. Many Thanks.

Are you referring to shortcuts? The days in the inspector are the “assigned” dates to a note (the date you pick when clicking the calendar at the right side of the note title).

I was not referring to shortcuts. Whether assigned or created does not matter for the larger question. I was asking how I could correctly format combined date actions in a script to retrieve and act on that information. ie; to calculate days since assigned or created, days remaining to due date, days since last edit. Thanks

PS: I was thinking that since the information presented in the pop-up was calculated, the formula must already exist.

The math is quite simple, we take the assigned date and map it to its day in the year, then calculate the difference with today.

let day = Day(for: assignedDate)
let daysSinceToday = day.days(since:

Thank you very much. It’s the nesting I was having problems with, and variable names. [quote=“mekentosj, post:4, topic:112975”]
let daysSinceToday = day.days(since:

Thanks again