Skip to content

Commit 8ff97c2

Browse files
committed
v0.23.1 refactor shiftDates() and processDateOffsets()
1 parent 871d88e commit 8ff97c2

File tree

4 files changed

+217
-135
lines changed

4 files changed

+217
-135
lines changed

helpers/paragraph.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,3 +941,24 @@ export function addParagraphsToNote(
941941
logError('paragraph/addParagraphsToNote', err.message)
942942
}
943943
}
944+
945+
/**
946+
* Set any complete or cancelled task/checklist paragraph to not complete. Will leave other paragraph types unchanged.
947+
* @author @jgclark
948+
* @param {TParagraph} paragraph to set to incomplete
949+
*/
950+
export function setParagraphToIncomplete(p: TParagraph): void {
951+
if (p.type === 'done') {
952+
logDebug('setParagraphToIncomplete', `>> changed done -> open`)
953+
p.type = 'open'
954+
} else if (p.type === 'cancelled') {
955+
logDebug('setParagraphToIncomplete', `>> changed cancelled -> open`)
956+
p.type = 'open'
957+
} else if (p.type === 'checklistDone') {
958+
logDebug('setParagraphToIncomplete', `>> changed checklistDone -> checklist`)
959+
p.type = 'checklist'
960+
} else if (p.type === 'checklistCancelled') {
961+
logDebug('setParagraphToIncomplete', `>> changed checklistCancelled -> checklist`)
962+
p.type = 'checklist'
963+
}
964+
}

jgclark.EventHelpers/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
See [website README for more details](https://github.com/NotePlan/plugins/tree/main/jgclark.EventHelpers), and how to configure.
44

5+
## [0.23.1] - 2025-10-20 @jgclark
6+
- fix regression in '/shift dates' command on tasks scheduled to weeks
7+
58
## [0.23.0] - 2025-08-22 @jgclark
69
### New
710
- new command **/insert week's events as list**, which inserts this week's calendar events in the current note (for @ScottC)
@@ -10,7 +13,7 @@ See [website README for more details](https://github.com/NotePlan/plugins/tree/m
1013
- changed setting 'Processed tag name' to 'Processed indicator string' to clarify that you can use any string, not just hashtags. And added a note that if this string contains an emoji then it sometimes triggers a bug in NotePlan where you get some repeated characters at the end of the line.
1114
### Fixed
1215
- regression on "/time blocks to calendar" (thanks, @WalterMusings)
13-
- stopped timeblocks being falsely generated from `@done(...)` strings under some ssettings
16+
- stopped timeblocks being falsely generated from `@done(...)` strings under some settings
1417

1518
## [0.22.2] - 2025-08-19 @jgclark
1619
- add 'add computed final date' setting for '/process date offsets' command. (Previously it always added a final computed date to the relevant section heading. Now this can be turned off.)

jgclark.EventHelpers/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"plugin.author": "jgclark",
99
"plugin.url": "https://github.com/NotePlan/plugins/tree/main/jgclark.EventHelpers",
1010
"plugin.changelog": "https://github.com/NotePlan/plugins/tree/main/jgclark.EventHelpers/CHANGELOG.md",
11-
"plugin.version": "0.23.0",
12-
"plugin.lastUpdateInfo": "0.23.0: new command '/insert week's events as list'. Fix regression.\n0.22.2: add 'add computed final date' setting to '/process date offsets' command.\n0.22.1: improve setting defaults and documentation.\n0.22.0: can now use events() template calls in Weekly notes.\n0.21.3: bug fix adding time blocks to calendar.\n0.21.2: /shiftDates now covers more cases.\n0.21.1: add 'Yes to all' to option to create time blocks. Extend '/shift dates' to work on week dates.\n0.21.0: improvements to '/shift dates' and '/process date offsets'.",
11+
"plugin.version": "0.23.1",
12+
"plugin.lastUpdateInfo": "0.23.1: fix regression in '/shift dates' command.\n0.23.0: new command '/insert week's events as list'. Fix regression.\n0.22.2: add 'add computed final date' setting to '/process date offsets' command.\n0.22.1: improve setting defaults and documentation.\n0.22.0: can now use events() template calls in Weekly notes.\n0.21.3: bug fix adding time blocks to calendar.\n0.21.2: /shiftDates now covers more cases.\n0.21.1: add 'Yes to all' to option to create time blocks. Extend '/shift dates' to work on week dates.\n0.21.0: improvements to '/shift dates' and '/process date offsets'.",
1313
"plugin.dependencies": [],
1414
"plugin.script": "script.js",
1515
"plugin.isRemote": "false",

0 commit comments

Comments
 (0)