From 90c6b55ad7585b68fae167dfe321f947304c500a Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 28 Sep 2022 14:09:21 +0200 Subject: [PATCH] added the ability to copy the table as markdown or csv --- README.md | 1 - src/settings-tab.ts | 13 ++- src/settings.ts | 4 +- src/tracker.ts | 98 +++++++++++++++---- styles.css | 7 +- .../obsidian-simple-time-tracker/data.json | 3 +- .../obsidian-simple-time-tracker/main.js | 95 +++++++++++++----- .../obsidian-simple-time-tracker/styles.css | 7 +- test-vault/Cool Project.md | 14 ++- 9 files changed, 191 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 095347c..4f97cab 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ The tracker's information is stored in the code block as JSON data. The names, s Super Simple Time Tracker is still in its early stages! There are a lot of plans for it, including: - A setting to link segments to corresponding daily notes automatically - A neat interface to edit previous segments' names and time stamps -- The ability to copy the table in various formats, including as text, markdown, and csv - A fancier Start and End button # 🙏 Acknowledgements diff --git a/src/settings-tab.ts b/src/settings-tab.ts index 05f5398..27594a1 100644 --- a/src/settings-tab.ts +++ b/src/settings-tab.ts @@ -20,7 +20,7 @@ export class SimpleTimeTrackerSettingsTab extends PluginSettingTab { .setDesc(createFragment(f => { f.createSpan({ text: "The way that timestamps in time tracker tables should be displayed. Uses " }); f.createEl("a", { text: "moment.js", href: "https://momentjs.com/docs/#/parsing/string-format/" }); - f.createSpan({ text: " syntax. Clear to reset to default." }); + f.createSpan({ text: " syntax." }); })) .addText(t => { t.setValue(String(this.plugin.settings.timestampFormat)); @@ -30,6 +30,17 @@ export class SimpleTimeTrackerSettingsTab extends PluginSettingTab { }); }); + new Setting(this.containerEl) + .setName("CSV Delimiter") + .setDesc("The delimiter character that should be used when copying a tracker table as CSV. For example, some languages use a semicolon instead of a comma.") + .addText(t => { + t.setValue(String(this.plugin.settings.csvDelimiter)); + t.onChange(async v => { + this.plugin.settings.csvDelimiter = v.length ? v : defaultSettings.csvDelimiter; + await this.plugin.saveSettings(); + }); + }); + this.containerEl.createEl("hr"); this.containerEl.createEl("p", { text: "If you like this plugin and want to support its development, you can do so through my website by clicking this fancy image!" }); this.containerEl.createEl("a", { href: "https://ellpeck.de/support" }) diff --git a/src/settings.ts b/src/settings.ts index 35256e1..2a59e68 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,9 +1,11 @@ export const defaultSettings: SimpleTimeTrackerSettings = { - timestampFormat: "YY-MM-DD hh:mm:ss" + timestampFormat: "YY-MM-DD hh:mm:ss", + csvDelimiter: "," }; export interface SimpleTimeTrackerSettings { timestampFormat: string; + csvDelimiter: string; } diff --git a/src/tracker.ts b/src/tracker.ts index f5f95fe..2e394a1 100644 --- a/src/tracker.ts +++ b/src/tracker.ts @@ -81,27 +81,36 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio let total = totalDiv.createEl("span", { cls: "simple-time-tracker-timer-time", text: "0s" }); totalDiv.createEl("span", { text: "Total" }); - // add table if (tracker.entries.length > 0) { + // add table let table = element.createEl("table", { cls: "simple-time-tracker-table" }); table.createEl("tr").append( createEl("th", { text: "Segment" }), createEl("th", { text: "Start time" }), createEl("th", { text: "End time" }), - createEl("th", { text: "Total" })); + createEl("th", { text: "Duration" })); for (let entry of tracker.entries) { let row = table.createEl("tr"); row.createEl("td", { text: entry.name }); - row.createEl("td", { text: moment.unix(entry.startTime).format(settings.timestampFormat) }); + row.createEl("td", { text: formatTimestamp(entry.startTime, settings) }); if (entry.endTime) { - row.createEl("td", { text: moment.unix(entry.endTime).format(settings.timestampFormat) }); - let duration = moment.unix(entry.endTime).diff(moment.unix(entry.startTime)); - row.createEl("td", { text: getCountdownDisplay(moment.duration(duration)) }); + row.createEl("td", { text: formatTimestamp(entry.endTime, settings) }); + row.createEl("td", { text: formatDurationBetween(entry.startTime, entry.endTime) }); } } + + // add copy buttons + let buttons = element.createEl("div", { cls: "simple-time-tracker-bottom" }); + new ButtonComponent(buttons) + .setButtonText("Copy as table") + .onClick(() => navigator.clipboard.writeText(createMarkdownTable(tracker, settings))); + new ButtonComponent(buttons) + .setButtonText("Copy as csv") + .onClick(() => navigator.clipboard.writeText(createCsv(tracker, settings))); } + setCountdownValues(tracker, current, total, currentDiv); let intervalId = window.setInterval(() => { // we delete the interval timer when the element is removed @@ -113,7 +122,35 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio }, 1000); } -function getCountdownDisplay(duration: moment.Duration): string { +function setCountdownValues(tracker: Tracker, current: HTMLElement, total: HTMLElement, currentDiv: HTMLDivElement) { + let currEntry = tracker.entries.last(); + if (currEntry) { + if (!currEntry.endTime) + current.setText(formatDurationBetween(currEntry.startTime, moment().unix())); + total.setText(formatDuration(getTotalDuration(tracker))); + } + currentDiv.hidden = !currEntry || !!currEntry.endTime; +} + +function getTotalDuration(tracker: Tracker): number { + let totalDuration = 0; + for (let entry of tracker.entries) { + let endTime = entry.endTime ? moment.unix(entry.endTime) : moment(); + totalDuration += endTime.diff(moment.unix(entry.startTime)); + } + return totalDuration; +} + +function formatTimestamp(timestamp: number, settings: SimpleTimeTrackerSettings): string { + return moment.unix(timestamp).format(settings.timestampFormat); +} + +function formatDurationBetween(startTime: number, endTime: number): string { + return formatDuration(moment.unix(endTime).diff(moment.unix(startTime))); +} + +function formatDuration(totalTime: number): string { + let duration = moment.duration(totalTime); let ret = ""; if (duration.hours() > 0) ret += duration.hours() + "h "; @@ -123,20 +160,39 @@ function getCountdownDisplay(duration: moment.Duration): string { return ret; } -function setCountdownValues(tracker: Tracker, current: HTMLElement, total: HTMLElement, currentDiv: HTMLDivElement) { - let currEntry = tracker.entries.last(); - if (currEntry) { - if (!currEntry.endTime) { - let currDuration = moment().diff(moment.unix(currEntry.startTime)); - current.setText(getCountdownDisplay(moment.duration(currDuration))); - } +function createMarkdownTable(tracker: Tracker, settings: SimpleTimeTrackerSettings): string { + let table = [["Segment", "Start time", "End time", "Duration"]]; + for (let entry of tracker.entries) + table.push(createTableRow(entry, settings)); + table.push(["**Total**", "", "", `**${formatDuration(getTotalDuration(tracker))}**`]); - let totalDuration = 0; - for (let entry of tracker.entries) { - let endTime = entry.endTime ? moment.unix(entry.endTime) : moment(); - totalDuration += endTime.diff(moment.unix(entry.startTime)); - } - total.setText(getCountdownDisplay(moment.duration(totalDuration))); + let ret = ""; + // calculate the width every column needs to look neat when monospaced + let widths = Array.from(Array(4).keys()).map(i => Math.max(...table.map(a => a[i].length))); + for (let r = 0; r < table.length; r++) { + // add separators after first row + if (r == 1) + ret += Array.from(Array(4).keys()).map(i => "-".repeat(widths[i])).join(" | ") + "\n"; + + let row: string[] = []; + for (let i = 0; i < 4; i++) + row.push(table[r][i].padEnd(widths[i], " ")); + ret += row.join(" | ") + "\n"; } - currentDiv.hidden = !currEntry || !!currEntry.endTime; + return ret; +} + +function createCsv(tracker: Tracker, settings: SimpleTimeTrackerSettings): string { + let ret = ""; + for (let entry of tracker.entries) + ret += createTableRow(entry, settings).join(settings.csvSeparator) + "\n"; + return ret; +} + +function createTableRow(entry: Entry, settings: SimpleTimeTrackerSettings): string[] { + return [ + entry.name, + formatTimestamp(entry.startTime, settings), + entry.endTime ? formatTimestamp(entry.endTime, settings) : "", + entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : ""]; } diff --git a/styles.css b/styles.css index 2eb222b..0d85443 100644 --- a/styles.css +++ b/styles.css @@ -20,7 +20,12 @@ margin-bottom: 10px; } -.simple-time-tracker-timers { +.simple-time-tracker-bottom button { + margin: 10px 5px 10px 5px; +} + +.simple-time-tracker-timers, +.simple-time-tracker-bottom { display: flex; justify-content: center; text-align: center; diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/data.json b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/data.json index 3a84795..675c344 100644 --- a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/data.json +++ b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/data.json @@ -1,3 +1,4 @@ { - "timestampFormat": "YY-MM-DD hh:mm:ss" + "timestampFormat": "YY-MM-DD hh:mm:ss", + "csvSeparator": "," } \ No newline at end of file diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js index d042e68..4d34ed1 100644 --- a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js +++ b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js @@ -54,7 +54,8 @@ var import_obsidian3 = __toModule(require("obsidian")); // src/settings.ts var defaultSettings = { - timestampFormat: "YY-MM-DD hh:mm:ss" + timestampFormat: "YY-MM-DD hh:mm:ss", + csvDelimiter: "," }; // src/settings-tab.ts @@ -70,7 +71,7 @@ var SimpleTimeTrackerSettingsTab = class extends import_obsidian.PluginSettingTa new import_obsidian.Setting(this.containerEl).setName("Timestamp Display Format").setDesc(createFragment((f) => { f.createSpan({ text: "The way that timestamps in time tracker tables should be displayed. Uses " }); f.createEl("a", { text: "moment.js", href: "https://momentjs.com/docs/#/parsing/string-format/" }); - f.createSpan({ text: " syntax. Clear to reset to default." }); + f.createSpan({ text: " syntax." }); })).addText((t) => { t.setValue(String(this.plugin.settings.timestampFormat)); t.onChange((v) => __async(this, null, function* () { @@ -78,6 +79,13 @@ var SimpleTimeTrackerSettingsTab = class extends import_obsidian.PluginSettingTa yield this.plugin.saveSettings(); })); }); + new import_obsidian.Setting(this.containerEl).setName("CSV Delimiter").setDesc("The delimiter character that should be used when copying a tracker table as CSV. For example, some languages use a semicolon instead of a comma.").addText((t) => { + t.setValue(String(this.plugin.settings.csvDelimiter)); + t.onChange((v) => __async(this, null, function* () { + this.plugin.settings.csvDelimiter = v.length ? v : defaultSettings.csvDelimiter; + yield this.plugin.saveSettings(); + })); + }); this.containerEl.createEl("hr"); this.containerEl.createEl("p", { text: "If you like this plugin and want to support its development, you can do so through my website by clicking this fancy image!" }); this.containerEl.createEl("a", { href: "https://ellpeck.de/support" }).createEl("img", { attr: { src: "https://ellpeck.de/res/generalsupport.png" }, cls: "simple-time-tracker-support" }); @@ -145,17 +153,19 @@ function displayTracker(tracker, element, getSectionInfo, settings) { totalDiv.createEl("span", { text: "Total" }); if (tracker.entries.length > 0) { let table = element.createEl("table", { cls: "simple-time-tracker-table" }); - table.createEl("tr").append(createEl("th", { text: "Segment" }), createEl("th", { text: "Start time" }), createEl("th", { text: "End time" }), createEl("th", { text: "Total" })); + table.createEl("tr").append(createEl("th", { text: "Segment" }), createEl("th", { text: "Start time" }), createEl("th", { text: "End time" }), createEl("th", { text: "Duration" })); for (let entry of tracker.entries) { let row = table.createEl("tr"); row.createEl("td", { text: entry.name }); - row.createEl("td", { text: import_obsidian2.moment.unix(entry.startTime).format(settings.timestampFormat) }); + row.createEl("td", { text: formatTimestamp(entry.startTime, settings) }); if (entry.endTime) { - row.createEl("td", { text: import_obsidian2.moment.unix(entry.endTime).format(settings.timestampFormat) }); - let duration = import_obsidian2.moment.unix(entry.endTime).diff(import_obsidian2.moment.unix(entry.startTime)); - row.createEl("td", { text: getCountdownDisplay(import_obsidian2.moment.duration(duration)) }); + row.createEl("td", { text: formatTimestamp(entry.endTime, settings) }); + row.createEl("td", { text: formatDurationBetween(entry.startTime, entry.endTime) }); } } + let buttons = element.createEl("div", { cls: "simple-time-tracker-bottom" }); + new import_obsidian2.ButtonComponent(buttons).setButtonText("Copy as table").onClick(() => navigator.clipboard.writeText(createMarkdownTable(tracker, settings))); + new import_obsidian2.ButtonComponent(buttons).setButtonText("Copy as csv").onClick(() => navigator.clipboard.writeText(createCsv(tracker, settings))); } setCountdownValues(tracker, current, total, currentDiv); let intervalId = window.setInterval(() => { @@ -166,7 +176,31 @@ function displayTracker(tracker, element, getSectionInfo, settings) { setCountdownValues(tracker, current, total, currentDiv); }, 1e3); } -function getCountdownDisplay(duration) { +function setCountdownValues(tracker, current, total, currentDiv) { + let currEntry = tracker.entries.last(); + if (currEntry) { + if (!currEntry.endTime) + current.setText(formatDurationBetween(currEntry.startTime, (0, import_obsidian2.moment)().unix())); + total.setText(formatDuration(getTotalDuration(tracker))); + } + currentDiv.hidden = !currEntry || !!currEntry.endTime; +} +function getTotalDuration(tracker) { + let totalDuration = 0; + for (let entry of tracker.entries) { + let endTime = entry.endTime ? import_obsidian2.moment.unix(entry.endTime) : (0, import_obsidian2.moment)(); + totalDuration += endTime.diff(import_obsidian2.moment.unix(entry.startTime)); + } + return totalDuration; +} +function formatTimestamp(timestamp, settings) { + return import_obsidian2.moment.unix(timestamp).format(settings.timestampFormat); +} +function formatDurationBetween(startTime, endTime) { + return formatDuration(import_obsidian2.moment.unix(endTime).diff(import_obsidian2.moment.unix(startTime))); +} +function formatDuration(totalTime) { + let duration = import_obsidian2.moment.duration(totalTime); let ret = ""; if (duration.hours() > 0) ret += duration.hours() + "h "; @@ -175,21 +209,36 @@ function getCountdownDisplay(duration) { ret += duration.seconds() + "s"; return ret; } -function setCountdownValues(tracker, current, total, currentDiv) { - let currEntry = tracker.entries.last(); - if (currEntry) { - if (!currEntry.endTime) { - let currDuration = (0, import_obsidian2.moment)().diff(import_obsidian2.moment.unix(currEntry.startTime)); - current.setText(getCountdownDisplay(import_obsidian2.moment.duration(currDuration))); - } - let totalDuration = 0; - for (let entry of tracker.entries) { - let endTime = entry.endTime ? import_obsidian2.moment.unix(entry.endTime) : (0, import_obsidian2.moment)(); - totalDuration += endTime.diff(import_obsidian2.moment.unix(entry.startTime)); - } - total.setText(getCountdownDisplay(import_obsidian2.moment.duration(totalDuration))); +function createMarkdownTable(tracker, settings) { + let table = [["Segment", "Start time", "End time", "Duration"]]; + for (let entry of tracker.entries) + table.push(createTableRow(entry, settings)); + table.push(["**Total**", "", "", `**${formatDuration(getTotalDuration(tracker))}**`]); + let ret = ""; + let widths = Array.from(Array(4).keys()).map((i) => Math.max(...table.map((a) => a[i].length))); + for (let r = 0; r < table.length; r++) { + if (r == 1) + ret += Array.from(Array(4).keys()).map((i) => "-".repeat(widths[i])).join(" | ") + "\n"; + let row = []; + for (let i = 0; i < 4; i++) + row.push(table[r][i].padEnd(widths[i], " ")); + ret += row.join(" | ") + "\n"; } - currentDiv.hidden = !currEntry || !!currEntry.endTime; + return ret; +} +function createCsv(tracker, settings) { + let ret = ""; + for (let entry of tracker.entries) + ret += createTableRow(entry, settings).join(settings.csvSeparator) + "\n"; + return ret; +} +function createTableRow(entry, settings) { + return [ + entry.name, + formatTimestamp(entry.startTime, settings), + entry.endTime ? formatTimestamp(entry.endTime, settings) : "", + entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : "" + ]; } // src/main.ts @@ -223,4 +272,4 @@ var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { }); } }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy9zZXR0aW5ncy10YWIudHMiLCAic3JjL3RyYWNrZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IFBsdWdpbiB9IGZyb20gXCJvYnNpZGlhblwiO1xyXG5pbXBvcnQgeyBkZWZhdWx0U2V0dGluZ3MsIFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3MgfSBmcm9tIFwiLi9zZXR0aW5nc1wiO1xyXG5pbXBvcnQgeyBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzVGFiIH0gZnJvbSBcIi4vc2V0dGluZ3MtdGFiXCI7XHJcbmltcG9ydCB7IGRpc3BsYXlUcmFja2VyLCBsb2FkVHJhY2tlciB9IGZyb20gXCIuL3RyYWNrZXJcIjtcclxuXHJcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNpbXBsZVRpbWVUcmFja2VyUGx1Z2luIGV4dGVuZHMgUGx1Z2luIHtcclxuXHJcblx0c2V0dGluZ3M6IFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3M7XHJcblxyXG5cdGFzeW5jIG9ubG9hZCgpOiBQcm9taXNlPHZvaWQ+IHtcclxuXHRcdGF3YWl0IHRoaXMubG9hZ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3duU2VjdGlvbkluZm9ybWF0aW9uLCBzZXR0aW5nczogU2ltcGxlVGltZVRyYWNrZXJTZXR0aW5ncyk6IHZvaWQge1xyXG4gICAgLy8gYWRkIHN0YXJ0L3N0b3AgY29udHJvbHNcclxuICAgIGxldCBydW5uaW5nID0gaXNSdW5uaW5nKHRyYWNrZXIpO1xyXG4gICAgbGV0IGJ0biA9IG5ldyBCdXR0b25Db21wb25lbnQoZWxlbWVudClcclxuICAgICAgICAuc2V0QnV0dG9uVGV4dChydW5uaW5nID8gXCJFbmRcIiA6IFwiU3RhcnRcIilcclxuICAgICAgICAub25DbGljayhhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgIGlmIChydW5uaW5nKSB7XHJcbiAgICAgICAgICAgICAgICBlbmRFbnRyeSh0cmFja2VyKTtcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHN0YXJ0RW50cnkodHJhY2tlciwgbmFtZS5nZXRWYWx1ZSgpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBhd2FpdCBzYXZlVHJhY2tlcih0cmFja2VyLCB0aGlzLmFwcCwgZ2V0U2VjdGlvbkluZm8oKSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICBidG4uYnV0dG9uRWwuYWRkQ2xhc3MoXCJzaW1wbGUtdGltZS10cmFja2VyLWJ0blwiKTtcclxuICAgIGxldCBuYW1lID0gbmV3IFRleHRDb21wb25lbnQoZWxlbWVudClcclxuICAgICAgICAuc2V0UGxhY2Vob2xkZXIoXCJTZWdtZW50IG5hbWVcIilcclxuICAgICAgICAuc2V0RGlzYWJsZWQocnVubmluZyk7XHJcbiAgICBuYW1lLmlucHV0RWwuYWRkQ2xhc3MoXCJzaW1wbGUtdGltZS10cmFja2VyLXR4dFwiKTtcclxuXHJcbiAgICAvLyBhZGQgdGltZXJzXHJcbiAgICBsZXQgdGltZXIgPSBlbGVtZW50LmNyZWF0ZURpdih7IGNsczogXCJzaW1wbGUt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KTtcclxuICAgIGxldCBpbnRlcnZhbElkID0gd2luZG93LnNldEludGVydmFsKCgpID0+IHtcclxuICAgICAgICAvLyB3ZSBkZWxldGUgdGhlIGludGVydmFsIHRpbWVyIHdoZW4gdGhlIGVsZW1lbnQgaXMgcmVtb3ZlZFxyXG4gICAgICAgIGlmICghZWxlbWVudC5pc0Nvbm5lY3RlZCkge1xyXG4gICAgICAgICAgICB3aW5kb3cuY2xlYXJJbnRlcnZhbChpbnRlcnZhbElkKTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBzZXRDb3VudGRvd25WYWx1ZXModHJhY2tlciwgY3VycmVudCwgdG90YWwsIGN1cnJlbnREaXYpO1xyXG4gICAgfSwgMTAwMCk7XHJcbn1cclxuXHJcbmZ1bmN0aW9uIGdldENvdW50ZG93bkRpc3BsYXkoZHVyYXRpb246IG1vbWVudC5EdXJhdGlvbik6IHN0cmluZyB7XHJcbiAgICBsZXQgcmV0ID0gXCJcIjtcclxuICAgIGlmIChkdXJhdGlvbi5ob3VycygpID4gMClcclxuICAgICAgICByZXQgKz0gZHVyYXRpb24uaG91cnMoKSArIFwiaCBcIjtcclxuICAgIGlmIChkdXJhdGlvbi5taW51dGVzKCkgPiAwKVxyXG4gICAgICAgIHJldCArPSBkdXJhdGlvbi5taW51dGVzKCkgKyBcIm0gXCI7XHJcbiAgICByZXQgKz0gZHVyYXRpb24uc2Vjb25kcygpICsgXCJzXCI7XHJcbiAgICByZXR1cm4gcmV0O1xyXG59XHJcblxyXG5mdW5jdGlvbiBzZXRDb3VudGRvd25WYWx1ZXModHJhY2tlcjogVHJhY2tlciwgY3VycmVudDogSFRNTEVsZW1lbnQsIHRvdGFsOiBIVE1MRWxlbWVudCwgY3VycmVudERpdjogSFRNTERpdkVsZW1lbnQpIHtcclxuICAgIGxldCBjdXJyRW50cnkgPSB0cmFja2VyLmVudHJpZXMubGFzdCgpO1xyXG4gICAgaWYgKGN1cnJFbnRyeSk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BQTtBQUM3QixZQUFNLEtBQUs7QUFFWCxXQUFLLGNBQWMsSUFBSSw2QkFBNkIsS0FBSyxLQUFLO0FBRTlELFdBQUssbUNBQW1DLHVCQUF1QixDQUFDLEdBQUcsR0FBRyxNQUFNO0FBQzNFLFlBQUksVUFBVSxZQUFZO0FBQzFCLFVBQUU7QUFDRix1QkFBZSxTQUFTLEdBQUcsTUFBTSxFQUFFLGVBQWUsSUFBSSxLQUFLO0FBQUE7QUFHNUQsV0FBSyxXQUFXO0FBQUEsUUFDZixJQUFJO0FBQUEsUUFDSixNQUFNO0FBQUEsUUFDTixnQkFBZ0IsQ0FBQyxHQUFHLE1BQU07QUFDekIsWUFBRSxpQkFBaUI7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBS2hCLGVBQWU7QUFBQTtBQUNwQixXQUFLLFdBQVcsT0FBTyxPQUFPLElBQUksaUJBQWlCLE1BQU0sS0FBSztBQUFBO0FBQUE7QUFBQSxFQUd6RCxlQUFlO0FBQUE7QUFDcEIsWUFBTSxLQUFLLFNBQVMsS0FBSztBQUFBO0FBQUE7QUFBQTsiLAogICJuYW1lcyI6IFtdCn0K diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/styles.css b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/styles.css index 2eb222b..0d85443 100644 --- a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/styles.css +++ b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/styles.css @@ -20,7 +20,12 @@ margin-bottom: 10px; } -.simple-time-tracker-timers { +.simple-time-tracker-bottom button { + margin: 10px 5px 10px 5px; +} + +.simple-time-tracker-timers, +.simple-time-tracker-bottom { display: flex; justify-content: center; text-align: center; diff --git a/test-vault/Cool Project.md b/test-vault/Cool Project.md index c6f0a37..5c70966 100644 --- a/test-vault/Cool Project.md +++ b/test-vault/Cool Project.md @@ -2,5 +2,17 @@ These are the notes for my cool project. There's so much left to do! I wish I had a way to track the amount of time I spend on each part of the project. ```simple-time-tracker -{"entries":[{"name":"Think about project","startTime":1664305777,"endTime":1664308788},{"name":"Create project note","startTime":1664308810,"endTime":1664308815},{"name":"Work on project","startTime":1664308830,"endTime":1664309301}]} +{"entries":[{"name":"Think about project","startTime":1664305777,"endTime":1664308788},{"name":"Create project note","startTime":1664308810,"endTime":1664308815},{"name":"Work on project","startTime":1664308830,"endTime":1664309301},{"name":"Segment 4","startTime":1664364444,"endTime":1664364449},{"name":"Segment 5","startTime":1664364495,"endTime":1664364498}]} ``` + +``` +Think about project;22-09-27 09:09:37;22-09-27 09:59:48;50m 11s +Create project note;22-09-27 10:00:10;22-09-27 10:00:15;5s +Work on project;22-09-27 10:00:30;22-09-27 10:08:21;7m 51s +Segment 4;22-09-28 01:27:24;22-09-28 01:27:29;5s +Segment 5;22-09-28 01:28:15;22-09-28 01:28:18;3s + +``` + + +