Multi-purpose time trackers for your notes!
Find a file
2024-11-14 10:54:43 -03:00
.github first setup 2022-09-27 15:36:25 +02:00
src add total today 2024-11-14 00:52:05 -03:00
test-vault fixed arrows not being displayed for markdown content 2024-08-09 19:55:54 +02:00
.editorconfig ignore vault files 2023-08-11 19:32:43 +02:00
.gitignore merge 2023-09-08 13:26:35 +02:00
CONTRIBUTING.md info stuff 2022-09-27 22:15:16 +02:00
esbuild.config.mjs cleanup 2023-05-22 20:01:50 +02:00
LICENSE first setup 2022-09-27 15:36:25 +02:00
manifest.json added funding url 2024-09-02 12:08:05 +02:00
package-lock.json 1.0.3 2024-08-09 19:56:59 +02:00
package.json 1.0.3 2024-08-09 19:56:59 +02:00
README.md updated screenshot link and image to reflect current plugin version (#66) 2024-11-14 13:44:33 +01:00
screenshot.jpg updated screenshot link and image to reflect current plugin version (#66) 2024-11-14 13:44:33 +01:00
styles.css improved collapse styling 2024-08-09 18:56:04 +02:00
tsconfig.json cleanup 2023-05-22 20:01:50 +02:00
versions.json 1.0.3 2024-08-09 19:56:59 +02:00

Super Simple Time Tracker

Multi-purpose time trackers for your notes!

A screenshot of the plugin in action, where you can see an active time tracker for a project

🤔 Usage

To get started tracking your time with Super Simple Time Tracker, open up the note that you want to track your time in. Move the cursor to the area you want the tracker to reside in, and then open your command palette and execute the Super Simple Time Tracker: Insert Time Tracker command.

When switching to live preview or reading mode, you will now see the time tracker you just inserted! Now, simply name the first segment (or leave the box empty if you don't want to name it) and press the Start button. Once you're done with the thing you were doing, simply press the End button and the time you spent will be saved and displayed to you in the table.

Need help using the plugin? Feel free to join the Discord server!

Join the Discord server

🔍 Tracker Data in Dataview

Super Simple Time Tracker has a public API that can be used with Dataview, specifically DataviewJS, which can be accessed using the following code:

dv.app.plugins.plugins["simple-time-tracker"].api;

The following is a short example that uses DataviewJS to load all trackers in the vault and print the total duration of each tracker. You can also find this example in action in the test vault.

// get the time tracker plugin api instance
let api = dv.app.plugins.plugins["simple-time-tracker"].api;

for (let page of dv.pages()) {
    // load trackers in the file with the given path
    let trackers = await api.loadAllTrackers(page.file.path);

    if (trackers.length)
        dv.el("strong", "Trackers in " + page.file.name);

    for (let { section, tracker } of trackers) {
        // print the total duration of the tracker
        let duration = api.getTotalDuration(tracker.entries);
        dv.el("p", api.formatDuration(duration));
    }
}

A full list of the functions exposed through the API can be found in the code. Proper documentation for the API will be added in the future.

👀 What it does

A time tracker is really just a special code block that stores information about the times you pressed the Start and End buttons on. Since time is tracked solely through timestamps, you can switch notes, close Obsidian or even shut down your device completely while the tracker is running! Once you come back, your time tracker will still be running.

The tracker's information is stored in the code block as JSON data. The names, start times and end times of each segment are stored. They're displayed neatly in the code block in preview or reading mode.

🙏 Acknowledgements

If you like this plugin and want to support its development, you can do so through my website by clicking this fancy image!

Support me (if you want), via Patreon, Ko-fi or GitHub Sponsors