Skip to content

Commit a46d5f8

Browse files
Things - Set Reminders in Today and Upcoming (#18771)
* Update things extension - feat: allow setting todo reminder in today and upcoming - Initial commit * Update things extension - feat: allow setting todo reminder in today and upcoming - feat: allow setting todo reminder in today and upcoming * Update things extension - feat: allow setting todo reminder in today and upcoming - feat: allow setting todo reminder in today and upcoming * Update things extension - refactor: move reminder functionality to schedule date action - refactor: leverage pick date action for setting reminder * refactor: leverage isFullDay function * refactor: avoid timezone conversion and use early return * Update things extension - refactor: avoid timezone conversion and use early return - refactor: avoid timezone conversion and use early return * Update things extension - fix(deadline): fix deadline removal - refactor: update deadline to use formatted date time * docs: update changelog with deadline action fix * Update CHANGELOG.md and optimise images --------- Co-authored-by: raycastbot <[email protected]>
1 parent 59dfb27 commit a46d5f8

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

extensions/things/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Things Changelog
22

3+
## [✨ Reminders] - 2025-05-06
4+
5+
- Update the "Today" and "Upcoming" lists to allow updating todo's reminders.
6+
- Fixed issue with the Deadline action to correctly remove a deadline from a todo.
7+
38
## [✨ Fix Complete Menu Bar Action] - 2025-04-25
49

510
- Fix `Complete` menu bar action to mark the first incomplete todo as complete, rather than completing the first item in the list, even if it is already marked as completed.
@@ -56,6 +61,7 @@
5661
Ever wanted to add a new to-do to Things with plain, natural text? Well, it's possible now with the new `Quick Add To-Do` command. Just type in your to-do text, maybe set some notes and checklist items and you're good to go.
5762

5863
Under the hood, it'll analyze and process your text to extract these parameters:
64+
5965
- The title
6066
- The start date
6167
- The project or area the to-do belongs to
@@ -65,6 +71,7 @@ Under the hood, it'll analyze and process your text to extract these parameters:
6571
- If it's completed or canceled
6672

6773
Here are some examples:
74+
6875
- Book flights today in my Trips list
6976
- Add milk to my groceries list for tomorrow with Errand tag
7077
- Respond to mails
@@ -81,6 +88,7 @@ A big update has been released for the Things extension. Here's what's new:
8188
### New actions
8289

8390
You now have additional actions for your to-dos:
91+
8492
- Schedule
8593
- Move to a project/area
8694
- Edit the title or notes

extensions/things/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"vimtor",
1515
"samuelkraft",
1616
"bendrucker",
17-
"vmrjnvc"
17+
"vmrjnvc",
18+
"dinocosta"
1819
],
1920
"license": "MIT",
2021
"commands": [
@@ -429,7 +430,8 @@
429430
"build": "ray build -e dist",
430431
"dev": "ray develop",
431432
"fix-lint": "ray lint --fix",
432-
"lint": "ray lint"
433+
"lint": "ray lint",
434+
"publish": "npx @raycast/api@latest publish"
433435
},
434436
"platforms": [
435437
"macOS"

extensions/things/src/components/TodoListItemActions.tsx

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ New title:
139139
await updateAction({ 'add-tags': tag }, { title: 'Added tag' });
140140
}
141141

142-
async function setDeadline(date: Date) {
143-
await updateAction({ deadline: date.toISOString() }, { title: 'Set deadline' });
142+
async function setDeadline(date: string | null) {
143+
const title = date === null ? 'Removed deadline' : 'Set deadline';
144+
const deadline = date === null ? '' : date;
145+
146+
await updateAction({ deadline }, { title });
144147
}
145148

146149
async function deleteToDo() {
@@ -161,6 +164,24 @@ New title:
161164
}
162165
}
163166

167+
function formatDateTime(date: Date): string {
168+
const year = date.getFullYear();
169+
const month = String(date.getMonth() + 1).padStart(2, '0');
170+
const day = String(date.getDate()).padStart(2, '0');
171+
const datePart = `${year}-${month}-${day}`;
172+
173+
// If the user picked a full day, we avoid providing the time, as
174+
// Things leverages the time part to understand whether a reminder
175+
// should be set.
176+
if (Action.PickDate.isFullDay(date)) {
177+
return datePart;
178+
}
179+
180+
const hours = String(date.getHours()).padStart(2, '0');
181+
const minutes = String(date.getMinutes()).padStart(2, '0');
182+
return `${datePart}@${hours}:${minutes}`;
183+
}
184+
164185
return (
165186
<ActionPanel>
166187
<ActionPanel.Section title={todo.name}>
@@ -208,8 +229,14 @@ New title:
208229
title="Date…"
209230
icon={Icon.Calendar}
210231
min={new Date()}
211-
onChange={(date) => schedule(date ? date.toISOString() : 'anytime')}
212-
type={Action.PickDate.Type.Date}
232+
onChange={(date) => {
233+
if (!date) {
234+
return schedule('anytime');
235+
}
236+
237+
return schedule(formatDateTime(date));
238+
}}
239+
type={Action.PickDate.Type.DateTime}
213240
/>
214241
<Action {...listItems.someday} onAction={() => schedule('someday')} />
215242
</ActionPanel.Submenu>
@@ -247,9 +274,7 @@ New title:
247274
shortcut={{ modifiers: ['cmd', 'shift'], key: 'd' }}
248275
min={new Date()}
249276
onChange={(date) => {
250-
if (date) {
251-
return setDeadline(date);
252-
}
277+
return setDeadline(date ? formatDateTime(date) : null);
253278
}}
254279
type={Action.PickDate.Type.Date}
255280
/>

0 commit comments

Comments
 (0)