Skip to content

Commit 0c36460

Browse files
authored
Merge pull request #686 from callumalpass:issue682
fix: apply parsed time estimates in creation modal
2 parents 98b9171 + be202a2 commit 0c36460

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/modals/TaskCreationModal.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,12 @@ export class TaskCreationModal extends TaskModal {
734734
if (parsed.tags && parsed.tags.length > 0) this.tags = sanitizeTags(parsed.tags.join(', '));
735735
if (parsed.details) this.details = parsed.details;
736736
if (parsed.recurrence) this.recurrenceRule = parsed.recurrence;
737+
if (parsed.estimate !== undefined) {
738+
this.timeEstimate = parsed.estimate > 0 ? parsed.estimate : 0;
739+
if (this.timeEstimateInput) {
740+
this.timeEstimateInput.value = this.timeEstimate > 0 ? this.timeEstimate.toString() : '';
741+
}
742+
}
737743

738744
// Update form inputs if they exist
739745
if (this.titleInput) this.titleInput.value = this.title;

src/modals/TaskModal.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export abstract class TaskModal extends Modal {
3939
protected contextsInput: HTMLInputElement;
4040
protected projectsInput: HTMLInputElement;
4141
protected tagsInput: HTMLInputElement;
42+
protected timeEstimateInput: HTMLInputElement;
4243
protected projectsList: HTMLElement;
4344
protected actionBar: HTMLElement;
4445
protected detailsContainer: HTMLElement;
@@ -288,6 +289,8 @@ export abstract class TaskModal extends Modal {
288289
.onChange(value => {
289290
this.timeEstimate = parseInt(value) || 0;
290291
});
292+
293+
this.timeEstimateInput = text.inputEl;
291294
});
292295

293296
// Dynamic user fields

0 commit comments

Comments
 (0)