I’ve got a Script I’ve written to send a task to Things with a prompt for what project and due date. For some reason, even when I have it configured (at least I think I have it configured) to send only a date, and not a time, Things still shows a reminder on the date selected, but at the time the action was run.
Here’s my code:
// Things Prompt for Project
// Create Prompt to ask user for project and select whether or not to add a heading
var p = Prompt.create();
p.title = "Project";
p.message = "Enter a Project Name";
// Create fields in prompt for project and heading
p.addTextField("project", "Project Name", "");
p.addTextField("heading", "Heading Name", "");
p.addSwitch("due", "Select Due Date?", true);
p.addButton("Done");
p.show();
var project = p.fieldValues["project"];
var heading = p.fieldValues["heading"];
if (p.fieldValues["due"] == true) {
var q = Prompt.create();
q.title = "Select Date";
q.message = "When would you like to complete this task?";
q.addDatePicker("date", "Date", new Date(), {"mode": "date"
});
q.addButton("Done");
q.show();
var when = q.fieldValues["date"];
}
else {
var when = ""
}
// Add task to todo with user input as project and heading.
var todo = TJSTodo.create();
todo.title = draft.content; // Use draft content for task title
todo.list = project;
todo.heading = heading;
todo.when = when;
var container = TJSContainer.create([todo]);
var cb = CallbackURL.create();
cb.baseURL = container.url;
var success = cb.open();
if (success) {
console.log("Task added to Things");
}
else {
context.fail();
}
If the spacing is weird, some things may have shifted in my pasting as code here.
Anyway, any help is appreciated.