Implement Slack flavored markdown reporting for report tasks

This commit is contained in:
Campbell Alden 2023-07-21 12:02:59 +09:00
parent 2c25aabc6a
commit 11fbaa582e
8 changed files with 715 additions and 2 deletions

24
src/things/today.js Normal file
View file

@ -0,0 +1,24 @@
var things = Application("Things");
var today = things.lists.byName("Today").toDos();
var objs = [];
today.forEach(todo => {
var proj = todo.project();
var tags = [];
if (proj) {
tags.push(...proj.tagNames().split(', '));
}
var area = todo.area() || proj && proj.area();
objs.push({
id: todo.id(),
title: todo.name(),
notes: todo.notes() || null,
status: todo.status(),
completion_date: todo.completionDate(),
project: proj && { id: proj.id(), title: proj.name() },
area: area && { id: area.id(), title: area.name() },
tags: [...tags, ...todo.tagNames().split(', ')].filter(t => t),
});
});
return JSON.stringify(objs, undefined, 2);