Skip to content

Commit d87d285

Browse files
committed
ActivityType.Task start now defaults to new Date()
1 parent 9a0048b commit d87d285

5 files changed

Lines changed: 5 additions & 33 deletions

File tree

.changeset/thirty-coins-punch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plotday/sdk": patch
3+
---
4+
5+
Changed: ActivityType.Task now has a default start of new Date()

sdk/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ Activities are the core data type in Plot, representing tasks, events, and notes
7777
await this.plot.createActivity({
7878
type: ActivityType.Task,
7979
title: "Review pull request",
80-
start: new Date(),
8180
links: [
8281
{
8382
type: ActivityLinkType.external,

sdk/cli/templates/AGENTS.template.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ async activate(_priority: Pick<Priority, "id">) {
112112
await this.plot.createActivity({
113113
type: ActivityType.Task,
114114
title: "Connect your account",
115-
start: new Date(),
116115
links: [authLink],
117116
});
118117
}
@@ -124,7 +123,6 @@ async activate(_priority: Pick<Priority, "id">) {
124123
const activity = await this.plot.createActivity({
125124
type: ActivityType.Task,
126125
title: "Setup",
127-
start: new Date(),
128126
});
129127

130128
await this.set("setup_activity_id", activity.id);
@@ -200,7 +198,6 @@ async activate(_priority: Pick<Priority, "id">) {
200198
const activity = await this.plot.createActivity({
201199
type: ActivityType.Task,
202200
title: "Connect Google account",
203-
start: new Date(),
204201
links: [authLink],
205202
});
206203

@@ -383,32 +380,6 @@ try {
383380
- **Clean up callbacks and stored state** - Delete callbacks and Store entries when no longer needed.
384381
- **Handle missing auth gracefully** - Check for stored auth before operations.
385382

386-
## Type Patterns
387-
388-
### Entity Types
389-
390-
Follow Plot's entity type patterns:
391-
392-
```typescript
393-
export type Activity = {
394-
id: string; // Required
395-
type: ActivityType; // Required
396-
title: string | null; // Nullable (not optional)
397-
note: string | null; // Nullable (not optional)
398-
start: Date | string | null; // Nullable (not optional)
399-
};
400-
401-
export type NewActivity = {
402-
type: Activity["type"]; // Only type is required
403-
} & Partial<Omit<Activity, "id" | "author" | "type">>;
404-
```
405-
406-
This pattern distinguishes between:
407-
408-
- Omitted fields (`undefined` in Partial types)
409-
- Explicitly set to null (clearing a value)
410-
- Set to a value
411-
412383
## Testing
413384

414385
Before deploying, verify:

sdk/src/common/calendar.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export interface SyncOptions {
7171
* type: ActivityType.Task,
7272
* title: "Connect Google Calendar",
7373
* links: [authLink],
74-
* start: new Date(),
7574
* });
7675
* }
7776
*

sdk/src/plot.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ export type ActivitySource = {
198198
* type: ActivityType.Task,
199199
* title: "Review budget proposal",
200200
* author: { id: "user-1", name: "John Doe", type: AuthorType.User },
201-
* start: new Date(),
202201
* end: null,
203202
* priority: { id: "work", title: "Work" },
204203
* // ... other fields
@@ -300,7 +299,6 @@ export type Activity = {
300299
* const newTask: NewActivity = {
301300
* type: ActivityType.Task,
302301
* title: "Review pull request",
303-
* start: new Date(),
304302
* links: [{
305303
* title: "View PR",
306304
* type: ActivityLinkType.external,

0 commit comments

Comments
 (0)