mirror of
https://github.com/Ellpeck/ObsidianSimpleTimeTracker.git
synced 2024-11-28 03:58:34 +01:00
Compare commits
No commits in common. "578eac6007ab22bf752e9c4e57256bc9d3ef6666" and "f11ce3e807713f2938af2d9533271266e7d17dc8" have entirely different histories.
578eac6007
...
f11ce3e807
2 changed files with 16 additions and 6 deletions
1
.prettierignore
Normal file
1
.prettierignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
**
|
|
@ -370,15 +370,25 @@ class EditableTimestampField extends EditableField {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableElement, newSegmentNameBox: TextComponent, trackerRunning: boolean, file: string, getSectionInfo: () => MarkdownSectionInformation, settings: SimpleTimeTrackerSettings, indent: number): void {
|
function addEditableTableRow(
|
||||||
|
tracker: Tracker,
|
||||||
|
entry: Entry,
|
||||||
|
table: HTMLTableElement,
|
||||||
|
newSegmentNameBox: TextComponent,
|
||||||
|
trackerRunning: boolean,
|
||||||
|
file: string,
|
||||||
|
getSectionInfo: () => MarkdownSectionInformation,
|
||||||
|
settings: SimpleTimeTrackerSettings,
|
||||||
|
indent: number
|
||||||
|
): void {
|
||||||
let entryRunning = getRunningEntry(tracker.entries) == entry;
|
let entryRunning = getRunningEntry(tracker.entries) == entry;
|
||||||
let row = table.createEl("tr");
|
let row = table.createEl("tr");
|
||||||
|
|
||||||
let nameField = new EditableField(row, indent, entry.name);
|
let nameField = new EditableField(row, indent, entry.name);
|
||||||
let startField = new EditableTimestampField(row, (entry.startTime), settings);
|
let startField = new EditableTimestampField(row, entry.startTime, settings);
|
||||||
let endField = new EditableTimestampField(row, (entry.endTime), settings);
|
let endField = new EditableTimestampField(row, entry.endTime, settings);
|
||||||
|
|
||||||
row.createEl("td", {text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry), settings) : ""});
|
row.createEl("td", { text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry), settings) : "" });
|
||||||
|
|
||||||
renderSegments(row, file);
|
renderSegments(row, file);
|
||||||
|
|
||||||
|
@ -430,8 +440,7 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle
|
||||||
});
|
});
|
||||||
|
|
||||||
if (entry.subEntries) {
|
if (entry.subEntries) {
|
||||||
for (let sub of orderedEntries(entry.subEntries, settings))
|
for (let sub of orderedEntries(entry.subEntries, settings)) addEditableTableRow(tracker, sub, table, newSegmentNameBox, trackerRunning, file, getSectionInfo, settings, indent + 1);
|
||||||
addEditableTableRow(tracker, sub, table, newSegmentNameBox, trackerRunning, file, getSectionInfo, settings, indent + 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue