| 372 | } |
| 373 | |
| 374 | private createMetadataSection(container: HTMLElement): void { |
| 375 | this.metadataContainer = container.createDiv("metadata-container"); |
| 376 | |
| 377 | const metadataLabel = this.metadataContainer.createDiv("detail-label"); |
| 378 | metadataLabel.textContent = this.t("modals.taskEdit.sections.taskInfo"); |
| 379 | |
| 380 | const metadataContent = this.metadataContainer.createDiv("metadata-content"); |
| 381 | const timeFormat = this.plugin.settings.calendarViewSettings?.timeFormat ?? "24"; |
| 382 | |
| 383 | // Total tracked time |
| 384 | const totalTimeSpent = calculateTotalTimeSpent(this.task.timeEntries || []); |
| 385 | if (totalTimeSpent > 0) { |
| 386 | this.createMetadataItem( |
| 387 | metadataContent, |
| 388 | this.t("modals.taskEdit.metadata.totalTrackedTime"), |
| 389 | formatTime(totalTimeSpent) |
| 390 | ); |
| 391 | } |
| 392 | |
| 393 | // Due date |
| 394 | if (this.task.due) { |
| 395 | this.createMetadataItem( |
| 396 | metadataContent, |
| 397 | this.t("modals.taskEdit.metadata.due"), |
| 398 | formatDateTimeForDisplay(this.task.due, { userTimeFormat: timeFormat }) |
| 399 | ); |
| 400 | } |
| 401 | |
| 402 | // Scheduled date |
| 403 | if (this.task.scheduled) { |
| 404 | this.createMetadataItem( |
| 405 | metadataContent, |
| 406 | this.t("modals.taskEdit.metadata.scheduled"), |
| 407 | formatDateTimeForDisplay(this.task.scheduled, { userTimeFormat: timeFormat }) |
| 408 | ); |
| 409 | } |
| 410 | |
| 411 | // Created date |
| 412 | if (this.task.dateCreated) { |
| 413 | this.createMetadataItem( |
| 414 | metadataContent, |
| 415 | this.t("modals.taskEdit.metadata.created"), |
| 416 | formatTimestampForDisplay(this.task.dateCreated) |
| 417 | ); |
| 418 | } |
| 419 | |
| 420 | // Modified date |
| 421 | if (this.task.dateModified) { |
| 422 | this.createMetadataItem( |
| 423 | metadataContent, |
| 424 | this.t("modals.taskEdit.metadata.modified"), |
| 425 | formatTimestampForDisplay(this.task.dateModified) |
| 426 | ); |
| 427 | } |
| 428 | |
| 429 | // File path (if available) |
| 430 | if (this.task.path) { |
| 431 | this.createMetadataItem( |