Skip to content

Commit fe23c51

Browse files
Merge pull request #64 from ChrisChinchilla/chrischinch/due-date-optional
2 parents 22d44cf + 43c5f6f commit fe23c51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/modal/card-create-modal.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,18 @@ export class CardCreateModal extends Modal {
5656
}
5757

5858
private onSave(): void {
59-
const dueDate = new Date(this.due.value).toISOString();
59+
let dueDate: string | undefined;
60+
if (this.due.value) {
61+
dueDate = new Date(this.due.value).toISOString().toString();
62+
}
6063

6164
this.plugin.api
6265
.addNewCard({
6366
idList: this.list.id,
6467
idLabels: Object.values(this.selectedLabels).map((label) => label.id),
6568
name: this.title.value,
6669
desc: this.description.value,
67-
due: dueDate.toString(),
70+
due: dueDate,
6871
pos: this.position.value as CardPosition
6972
})
7073
.pipe(map((resp) => resp.response))

0 commit comments

Comments
 (0)