Utility package: org-roam-timestamps

Hi all!

Over at org-roam-ui HQ, we’ve been thinking about doing more with dates: sort your notes by most recently written, see notes that haven’t gotten much attention, generate github like activity plots etc.
Unfortunately that was not really possibly with stock org-roam, as the only info stored is the last access and modification time of the file, not the node.

To that end I wrote a small package called org-roam-timestamps, which allows you to add mtime and ctime properties to your property drawers and keep them up to date, like this

You can choose to keep a modification history, or to just keep the last mtime. I chose a filebased approach over an extension to the db structure because the org-roam db is somewhat ephemeral, in that you should be able to regenerate the complete db from the files at any point in time. Just putting this info in a new table/column would therefore not be a good idea.

As said before, the main use-case for this will be in org-roam-ui, but I’m sure someone might be able to use it for something else as well :slight_smile:

The main drawback atm is that updating is somewhat slow and only updates the node your cursor is on at the time of saving. I might try to rework that, if someone has any good ideas (outside of the ones listed in the repo) I’ll be happy to discuss this!

5 Likes

Lil gif of it in action

output

2 Likes

That looks really nice! So far I’ve been using Update a field (#+LAST_MODIFIED: ) at save - #28 by savnk but that’s rather an adhoc solution.

1 Like

Thanks! Coincidentally I just updated this package today so it should work somewhat better than before. Let me know if you run into any problems!