You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logDebug('NPCalendar / writeTimeBlocksToCalendar',`- Will process time block '${timeBlockString}' for '${restOfTaskWithoutDateTime}'`)
236
+
logDebug('NPCalendar / writeTimeBlocksToCalendar',`- Will process time block '${timeBlockString}' with restOfTaskWithoutDateTime:'${restOfTaskWithoutDateTime}' / restOfTaskWithoutTimeBlock:'${restOfTaskWithoutTimeBlock}'`)
// FIXME(@EduardMe): there's something odd going on here. Often 3 characters are left or repeated at the end of the line as a result of this
272
+
// FIXME(@EduardMe): there's something odd going on here. Often 1 or 3 characters are left or repeated at the end of the line as a result of this. Perhaps to do with emojis?
Copy file name to clipboardExpand all lines: jgclark.EventHelpers/CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,15 @@
2
2
3
3
See [website README for more details](https://github.com/NotePlan/plugins/tree/main/jgclark.EventHelpers), and how to configure.
4
4
5
+
## [0.23.0] - 2025-08-22 @jgclark
6
+
### New
7
+
- new command **/insert week's events as list**, which inserts this week's calendar events in the current note
8
+
- new equivalent `insertWeeksEvents` and `listWeeksEvents` functions for use in automation (templating or x-callbacks)
9
+
### Changed
10
+
- 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.
11
+
### Fixed
12
+
- regression on "/time blocks to calendar"
13
+
5
14
## [0.22.2] - 2025-08-19 @jgclark
6
15
- 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.)
Copy file name to clipboardExpand all lines: jgclark.EventHelpers/README.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
# 🕓 Event Helpers plugin
2
2
This plugin provides commands to help you do useful things with Events and Calendars that can't (yet) be done by NotePlan itself:
3
3
4
-
-**insert day's events as list**: insert a list of this day's calendar events into the current note -- including doing so automatically in **day/week note templates**
5
-
-**insert matching events**: insert a list of this day's calendar events that match certain patterns into the current note
6
-
-**time blocks to calendar**: takes [NotePlan-defined time blocks](https://help.noteplan.co/article/52-part-2-tasks-events-and-reminders#timeblocking) and converts to them to full Calendar events in your current default calendar, as set by iCal. (See also [Display of Time Blocks](#display-of-time-blocks) below.)
7
-
-**process date offsets**: finds date offset patterns and turns them into due dates, based on date at start of section. (See [Date Offsets](#process-date-offsets) below for full details.)
4
+
-**insert day's events as list**: insert a list of this day's calendar events into the current note. Can be used automatically in a Daily note Template. Alias: **ide**.
5
+
-**insert week's events as list**: insert a list of all the day's calendar events for this week into the current note. Can be used automatically in a Weekly note Template. Alias: **ide**.
6
+
-**insert matching events**: insert a list of this day's calendar events that match certain patterns into the current note. Alias: **ime**.
7
+
-**time blocks to calendar**: takes [NotePlan-defined time blocks](https://help.noteplan.co/article/52-part-2-tasks-events-and-reminders#timeblocking) and converts to them to full Calendar events in your current default calendar, as set by iCal. (See also [Display of Time Blocks](#display-of-time-blocks) below.) Aliases: **tbtc** or **tbcal**.
8
+
-**process date offsets**: finds date offset patterns and turns them into due dates, based on date at start of section. (See [Date Offsets](#process-date-offsets) below for full details.) Alias: **offset**.
8
9
-**shift dates**: takes dates _in the selected lines_ and shifts them forwards or backwards by a given date interval. It works on both `>YYYY-MM-DD` and `>YYYY-Wnn` style dates. (User George Crump (@george65) has created a [video showing how this command works](https://storone.zoom.us/rec/play/tzI6AreYeKvoyHRw11HX93IGVf2OI-U7WgKXYn2rmGJvbFHXZp8PSr6ajmOrtWymOU5jFIItScSJnL9U.tboBQEXjdw1uRTqu).)
9
10
10
11
Most of these commands require configuration, described in the sections below. On macOS, click the gear button on the 'Event Helpers' line in the Plugin Preferences panel to access the settings. Or on on iOS/iPadOS devices, use the **Events: update plugin settings** command instead.
@@ -51,7 +52,7 @@ Settings:
51
52
-**Confirm Event Creation?**: optional boolean tag to indicate whether to ask user to confirm each event to be created
52
53
-**Remove time blocks when processed?**: in `time blocks...` whether to remove time block after making an event from it
53
54
-**Add event link?**: whether to add a nicely-formatted event link when creating an event from a time block. (This can return rather long strings (e.g. `⏰event:287B39C1-4D0A-46DC-BD72-84D79167EFDF`) and so you might want to use a theme option to shorten them until needed (details [below](#theme-customisation)).)
54
-
-**Processed tag name**: if this is set, then this tag will get added on the end of the line with the time block, to show that it has been processed. Otherwise, next time this command is run, it will create another event. This can be used with or without addEventID.
55
+
-**Processed indicator string**: if this is set, then this string will get added on the end of the line with the time block, to show that it has been processed. Otherwise, next time this command is run, it will create another event. This can be used with or without 'Add event link'.
55
56
-**Locale**: optional Locale to use for times in events. If not given, will default to what the OS reports, or failing that, 'en-US'.
56
57
-**Time options**: Optional Time format settings.
57
58
@@ -77,7 +78,7 @@ The following **Parameters** are available:
77
78
|`includeAllDayEvents`| boolean | include/exclude all day events |`includeAllDayEvents: false`|
78
79
|`calendarSet`| string | limit which calendars are included |`calendarSet:"list,of,calendar,names"`|
79
80
|`calendarNameMappings`| string | customize the name of the calendars |`calendarNameMappings:"Jonathan (iCloud);Me, Us (iCloud);Us"`|
80
-
|`daysToCover`| number | include more than the current day |`daysToCover: 3` includes today + 2 days |
81
+
|`daysToCover`| number | include more than the current day |`daysToCover: 3` includes today + the 2 following days |
81
82
|`format`| string | customize the format |`'format:"..."'`|
82
83
|`allday_format`| string | customize format for all day events |`'allday_format:"..."`|
83
84
@@ -86,6 +87,18 @@ You can include other text (including line breaks indicated by `\n`) within the
86
87
87
88
NB: the `Sort order` setting above also controls how the output of this list is sorted.
88
89
90
+
### Using Event Lists from Callbacks
91
+
As well as following x-callback calls are available:
92
+
93
+
| equivalent command | callback | parameters | result |
94
+
| ---- | ------ | ---- | --- |
95
+
| Insert day's events | noteplan://x-callback-url/runPlugin?pluginID=jgclark.EventHelpers&command=insertDaysEvents | JSON string (as above for Templates) | inserted to current note |
96
+
| Insert matching events | noteplan://x-callback-url/runPlugin?pluginID=jgclark.EventHelpers&command=insertMatchingDaysEvents | JSON string (as above for Templates) | inserted to current note |
97
+
| Insert week's events | noteplan://x-callback-url/runPlugin?pluginID=jgclark.EventHelpers&command=insertWeeksEvents | JSON string (as above for Templates) | inserted to current note |
98
+
| List day's events as list | noteplan://x-callback-url/runPlugin?pluginID=jgclark.EventHelpers&command=listDaysEvents | JSON string (as above for Templates) | returns list of events as a markdown string |
99
+
| List matching day's events as list | noteplan://x-callback-url/runPlugin?pluginID=jgclark.EventHelpers&command=listMatchingDaysEvents | JSON string (as above for Templates) | returns list of events as a markdown string |
100
+
| List week's events as list | noteplan://x-callback-url/runPlugin?pluginID=jgclark.EventHelpers&command=listWeeksEvents | JSON string (as above for Templates) | returns list of events as a markdown string |
101
+
89
102
## /shift dates
90
103
This command takes plain or scheduled day or week dates (i.e. `YYYY-MM-DD`, `>YYYY-MM-DD`, `YYYY-Wnn` or ``>YYYY-Wnn`) in the selected lines and shifts them forwards or backwards by a given date interval. This allows you to copy a set of tasks to use again, and have the dates moved forward by a month or year etc.
expect(result).toEqual('- (Jonathan) title of event1 https://example.com/easy\n> a few notes\n✓ Jonathan Clark, ? James Bond, x Martha, ? [email protected]')
constexpected='### (Jonathan, 20:00:00-22:00:00) title of event1 https://example.com/easy with Jonathan Clark, Martha Clark, [email protected]\n> a few notes\n---\n'
'- (Us) title of event2 with <brackets> & more https://example.com/bothersomeURL/example\n> a few notes with TITLE and URL\n✓ Jonathan Clark, ? James Bond, x Martha, ? [email protected]'
'### (Us, 20:00:00-22:00:00) title of event2 with <brackets> & more https://example.com/bothersomeURL/example with Jonathan Clark, Martha Clark, [email protected]\n> a few notes with TITLE and URL\n---\n'
129
129
expect(result).toEqual(expected)
130
130
})
131
131
test('event 2 format 3 for @EasyTarget with newlines and asterisks',()=>{
"plugin.lastUpdateInfo": "0.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.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'.",
13
13
"plugin.dependencies": [],
14
14
"plugin.script": "script.js",
15
15
"plugin.isRemote": "false",
16
16
"plugin.commands": [
17
17
{
18
18
"name": "time blocks to calendar",
19
+
"alias": [
20
+
"tbtc",
21
+
"tbcal"
22
+
],
19
23
"description": "promote time blocks to be full calendar events",
20
24
"jsFunction": "timeBlocksToCalendar"
21
25
},
22
26
{
23
27
"name": "insert day's events as list",
28
+
"alias": [
29
+
"events",
30
+
"ide"
31
+
],
24
32
"description": "insert list of this day's calendar events at cursor",
25
33
"jsFunction": "insertDaysEvents"
26
34
},
35
+
{
36
+
"name": "insert week's events as list",
37
+
"alias": [
38
+
"events",
39
+
"iwe"
40
+
],
41
+
"description": "insert list of this week's calendar events at cursor",
42
+
"jsFunction": "insertWeeksEvents"
43
+
},
27
44
{
28
45
"name": "insert matching events",
46
+
"alias": [
47
+
"ime"
48
+
],
29
49
"description": "inserts this day's calendar events matching certain patterns at cursor",
30
50
"jsFunction": "insertMatchingDaysEvents"
31
51
},
@@ -39,9 +59,6 @@
39
59
},
40
60
{
41
61
"name": "shift dates",
42
-
"alias": [
43
-
"offset"
44
-
],
45
62
"description": "takes dates in the selection and shifts them forwards or backwards by a given date interval",
46
63
"jsFunction": "shiftDates"
47
64
},
@@ -60,13 +77,28 @@
60
77
"name": "listDaysEvents",
61
78
"description": "function to list events for the current open Calendar note (for use in Templating)",
62
79
"hidden": true,
63
-
"jsFunction": "listDaysEvents"
80
+
"jsFunction": "listDaysEvents",
81
+
"parameters": [
82
+
"paras as JSON string"
83
+
]
64
84
},
65
85
{
66
86
"name": "listMatchingDaysEvents",
67
87
"description": "function to list events for the current open Calendar note that match string defined in the settings (for use in Templating)",
68
88
"hidden": true,
69
-
"jsFunction": "listMatchingDaysEvents"
89
+
"jsFunction": "listMatchingDaysEvents",
90
+
"parameters": [
91
+
"paras as JSON string"
92
+
]
93
+
},
94
+
{
95
+
"name": "listWeeksEvents",
96
+
"description": "function to list events for the current open Calendar note (for use in Templating or Callbacks)",
97
+
"hidden": true,
98
+
"jsFunction": "listWeeksEvents",
99
+
"parameters": [
100
+
"paras as JSON string"
101
+
]
70
102
},
71
103
{
72
104
"name": "Events: update plugin settings",
@@ -276,15 +308,15 @@
276
308
"title": "Add event link?",
277
309
"description": "Whether to add an event link in place of the time block, when creating an event from it",
278
310
"type": "bool",
279
-
"default": false,
311
+
"default": true,
280
312
"required": true
281
313
},
282
314
{
283
315
"key": "processedTagName",
284
-
"title": "Processed tag name",
285
-
"description": "(Optional) Tag to add on a line after making its time block an event",
316
+
"title": "Processed indicator string",
317
+
"description": "(Optional) String to add on a line after making its time block an event, for example '#event_created'. Note: if this contains an emoji then it sometimes triggers a bug in NotePlan where you get some repeated characters at the end of the line.",
0 commit comments