AutoDater
unlistedby Stanley Cheung
Automatically adds Created/Updated dates to YAML frontmatter.
AutoDater for Obsidian
Automatically adds and maintains Created and Updated dates in the YAML frontmatter of your Obsidian notes.
Why this plugin? π€
Have you ever lost valuable metadata like creation or modification dates when exporting notes, migrating between tools, or recovering from a backup? Standard file system metadata can be fragile.
This plugin solves that by embedding Created and Updated timestamps directly into the content of your notes within the YAML frontmatter. This ensures this important contextual information stays with the note itself, wherever it goes.
How it Works / Features β¨
- Automatic
CreatedDate: When you create a new note, the plugin automatically adds:(Where--- Created: YYYY-MM-DD Updated: YYYY-MM-DD ---YYYY-MM-DDis the current date). It will not modify existing files that lack these fields upon initial activation. - Automatic
UpdatedDate: Whenever you modify an existing note, the plugin:- Updates the
Updated:field to the current date (YYYY-MM-DD). - If the
Updated:field doesn't exist, it adds it. - If no YAML frontmatter exists at all, it creates the frontmatter block and adds the
Updated:field.
- Updates the
- Safe Updates: The plugin uses Obsidian's
processFrontMatterAPI to carefully add or update fields without overwriting other existing YAML data. It also includes built-in protection to prevent infinite update loops. - Lightweight & Robust: Designed to update efficiently. It uses a debounced update mechanism (2-second delay) to ensure it only writes to your file once you've finished typing, preventing unnecessary disk I/O and performance lag.
Installation βοΈ
Recommended Method (Once Published):
- Search for "AutoDater" in Obsidian's Community Plugins browser.
- Install it.
- Enable the plugin in your Obsidian settings under "Community Plugins".
Manual Installation (For now or for testing):
- Download the
main.js,styles.css(if any), andmanifest.jsonfiles from the latest release. - Navigate to your Obsidian vault's configuration folder:
<YourVault>/.obsidian/plugins/. - Create a new folder named
autodater(this should match theidin yourmanifest.json). - Place the downloaded files into this new folder.
- Go to Obsidian settings > Community Plugins.
- Refresh the list and enable "AutoDater".
Local Development π οΈ
If you want to build the plugin yourself or contribute:
- Clone this repository.
- Install dependencies:
npm install. - Build the plugin:
npm run dev: Starts a watch mode that rebuilds the plugin on changes.npm run build: Creates a production build in the root directory.
Changelog π
Version 1.1.0
- Robust File Handling: Implemented debouncing (2s) and loop protection to ensure safe and efficient file updates.
- Tooling Upgrade: Migrated to ESLint Flat Config, upgraded TypeScript to 6.0, and updated dependencies to the latest versions.
- Type Safety: Improved internal type definitions for safer frontmatter manipulation.
Version 1.0.0 (Initial Release)
- Plugin Created!
- Adds
CreatedandUpdatedfields (YYYY-MM-DD) to new notes. - Updates/adds
Updatedfield on note modification. - Uses
obsidianpackage'sprocessFrontMatterfor safe YAML handling.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.