Natural Language Dates

by obsidian-community
5
4
3
2
1
Score: 45/100

Description

Category: Productivity Tools

The Natural Language Dates plugin lets you turn plain date and time phrases into formatted text, wiki links and daily note links from inside the editor. It expands inline triggers like '@today' through autosuggest, can keep the typed phrase as an alias and adds commands for inserting the current date, current time or both in custom formats. Selected text can be parsed into dates, times, markdown links, wiki links or plain text, and the parser accepts relative dates, ranges and standard timestamp formats. It also includes a date picker command and an 'obsidian://nldates' URI action for opening daily notes from natural language input. Links are created only when the entered phrase is recognized as a date.

Reviews

No reviews yet.

Stats

9
stars
510,027
downloads
1
forks
27
days
28
days
28
days
6
total PRs
2
open PRs
1
closed PRs
3
merged PRs
2
total issues
2
open issues
0
closed issues
10
commits

Latest Version

a month ago

Changelog

Fixes and cleanup since 0.6.1:

  • Fix date suggest's compatibility with Obsidian's table editor
  • Switch to the preferred getLeaf API over the deprecated splitActiveLeaf
  • Remove old CM5 support
  • Minor code cleanup (const over let, drop unused imports/console logging)

Full Changelog: https://github.com/obsidian-community/nldates/compare/0.6.1...0.6.4

README file from

Github

Natural Language Dates in Obsidian

Insert timestamps and cross-link your daily notes with the flexibility of natural language. NLDates provides a suite of tools that makes working with dates and times within Obsidian frictionless.

✨ Maintained by Argenos and the Obsidian Community members.

Features

If a date is not recognized, the link won't be created.

Date Autosuggest

Expand dates using natural language inline within the editor view.

Typing @today Enter will automatically be expanded to the current date. Press Shift at the same time to keep the input text as an alias (e.g. @today[[202112-27|today]]).

Configuration

Setting Description Default
Enable/Disable A global toggle to enable or disable the autosuggest Enabled
Trigger phrase Character(s) required to open the autosuggest @
Insert as link? Dates will be inserted as wikilinks (i.e. [[<date>]]) Yes

nldates URI Action

It's now possible to use the Obsidian URI to open daily notes using natural language by using the nldates action obsidian://nldates?day=<date here>. Don't forget to encode space characters appropriately.

obsidian://nldates Parameter Description
day natural language date string
newPane open note in new pane, default is yes

Commands and Hotkeys

nldates adds a few commands to work with dates in natural language. You can add custom hotkeys for them by going to Settings > Hotkeys and filtering by Natural Language Dates (Note that hotkeys are unset by default starting on v0.4.1).

Natural Language Dates: Date Picker

Opens the date picker menu

Other Commands
Setting Description Default
Insert current date Inserts the current date, using the format specified in the settings menu YYYY-MM-DD
Insert current time Inserts the current time, using the format specified in the settings menu HH:mm
Insert current date and time Inserts the current date, using the format specified in the settings menu YYYY-MM-DD HH:mm
Parse natural language date Parses the selected text as a natural language date. Replaces selected text with an obsidian link to the parsed date in the format specified in the settings menu. For single-word dates (e.g. today, tomorrow, friday, etc.), it's possible to use the command without selecting the word first. It's also possible to use dates like Nov9, 25Dec to use this trick. [[YYYY-MM-DD]]
Parse natural language time Parses the selected text as a natural language time. Replaces selected text with the parsed time stamp in the format specified in the settings menu. You can try with any of the standard times, i.e. now, in 15min, in 1h, 5min ago, etc. HH:mm
Parse natural language date (as link) Parses the selected text as a natural language date. Replaces selected text with a standard markdown link to the parsed date in the format specified in the settings menu [selected text](YYYY-MM-DD)
Parse natural language date (as plain text) Parses the selected text as a natural language date. Replaces selected text with a plain text parsed date in the format specified in the settings menu YYYY-MM-DD

Note: You can of course add hotkeys to each of these commands.

Usage

Examples

The parser supports most date/time formats, including:

  • Today, Tomorrow, Yesterday, Last Friday, etc
  • 17 August 2013 - 19 August 2013
  • This Friday from 13:00 - 16.00
  • 5 days ago
  • 2 weeks from now
  • Sat Aug 17 2013 18:40:39 GMT+0900 (JST)
  • 2014-11-30T08:15:30-05:30

Demo

Note: The parser will replace all the selected text, meaning that in a sentence you should only select the dates to be parsed and not the full sentence.
In the example sentence Do this thing by tomorrow, only the word tomorrow should be selected. Alternatively, keep in mind that you can place your cursor on or next to the word tomorrow, and it will be replaced:

How to install

In Obsidian go to Settings > Third-party plugins > Community Plugins > Browse and search for Natural Language Dates.

Manual installation

Unzip the latest release into your <vault>/.obsidian/plugins/ folder.

About

Powered by the chrono library and some custom parsing.

Custom Parsing

The only behaviours I changed were the following:

Write Date
next week next Monday
next [month] 1st of next month
mid [month] 15th of the month
end of [month] last day of the month

For Developers

NLDates provides an interface for you to parse natural language dates in your plugin. The parsedDate() function is available on the NaturalLanguageDates plugin instance. It has the following signature:

interface NLDResult {
  formattedString: string;
  date: Date;
  moment: Moment;
}

function parseDate(date: string): NLDResult;
  • The formattedString will return the date formatted according to the settings of nldates and without the square brackets.
  • The date object is what is returned by the parseDate method of the custom parser (using the chrono package).
  • The moment object is created with the date object.

Example Usage

const nldatesPlugin = obsidianApp.plugins.getPlugin("nldates-obsidian");
const parsedResult = nldatesPlugin.parseDate("next year");
console.log(parsedResult.moment.format("YYYY")); // This should return 2021

Typical String Formats and Tokens

Input Example Description
YYYY 2014 4 or 2 digit year. Note: Only 4 digit can be parsed on strict mode
YY 14 2 digit year
Y -25 Year with any number of digits and sign
Q 1..4 Quarter of year. Sets month to first month in quarter.
M MM 1..12 Month number
MMM MMMM Jan..December Month name in locale set by moment.locale()
D DD 1..31 Day of month
Do 1st..31st Day of month with ordinal
DDD DDDD 1..365 Day of year
X 1410715640.579 Unix timestamp
x 1410715640579 Unix ms timestamp
gggg 2014 Locale 4 digit week year
gg 14 Locale 2 digit week year
w ww 1..53 Locale week of year
e 0..6 Locale day of week
ddd dddd Mon...Sunday Day name in locale set by moment.locale()
GGGG 2014 ISO 4 digit week year
GG 14 ISO 2 digit week year
W WW 1..53 ISO week of year
E 1..7 ISO day of week

For further information, see: moment.js docs.

Manipulating the moment instance

If you need, you can further manipulate or format the moment object, for example:

const nldatesPlugin = obsidianApp.plugins.getPlugin("nldates-obsidian");
const nextYear = nldatesPlugin.parseDate("next year");

console.log(nextYear.moment.format("YYYY")); // This should return 2021
console.log(nextYear.moment.fromNow()); // "In two months"

const thisEvening = nldatesPlugin.parseDate("today at 21:00");
console.log(thisEvening.moment.add(1, "hour")); // This would change the Moment to 22:00

Note that if you manipulate the parsedResult.moment, the date and formattedString won't be updated. If you don't want to alter the parsedResult.moment, you should clone it. Read more about that on the moment.js docs site.

Contributors

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
TimeStamper
5 years ago by Martin Eder
A plugin for Obsidian to quickly insert customized date- and time-stamps to the currently active note
Pinboard Sync
5 years ago by Mathew Spolin
Obsidian plugin to sync Pinboard.in links to Daily Notes
Daily notes opener
4 years ago by Reorx
Easily open daily notes and periodic notes in new pane; customize periodic notes background; quick append new line to daily notes.
Daily Notes Viewer
4 years ago by Johnson0907
Upcoming
4 years ago by Charlie Chao
Show upcoming daily notes in their own panes.
Timestamp Notes
4 years ago by Julian Grunauer
This plugin allows side-by-side notetaking with videos. Annotate your notes with timestamps to directly control the video and remember where each note comes from.
TimeDiff plugin
4 years ago by Grzegorz Dominiczak
Obsidian plugin which calculates and displays diff in hours and minutes between two dates in `timediff` markdown block
Repeat
4 years ago by Andre Perunicic
Review notes using periodic or spaced repetition.
Actions URI
4 years ago by Carlo Zottmann
A plugin for Obsidian (https://obsidian.md) that adds additional `x-callback-url` endpoints to the app for common actions — it's a clean, super-charged addition to Obsidian URI.
Daily Note Outline
4 years ago by iiz
Add a custom view which shows outline of multiple daily notes with headings, links, tags and list items
New Bullet With Time
4 years ago by Boninall
A plugin allows you to auto add current time to new bullet line.
Task Marker
4 years ago by wenlzhang
An Obsidian plugin to change task status and append text with hotkeys and right-click context menu.
ProgressBar
3 years ago by Wei Zhang
Code block plugin for Obsidian generating a progress bar
Journal Review
3 years ago by Kageetai
Review your daily notes on their anniversaries, like "what happened today last year"
Last Modified Timestamp in Status Bar
3 years ago by Yustynn
Time Ruler
3 years ago by Joshua Tazman Reinier
A drag-and-drop time ruler combining the best of a task list and a calendar view (integrates with Tasks, Full Calendar, and Dataview).
Waka time box
3 years ago by complexzeng
Reflection
3 years ago by Brandon Boswell
An Obsidian Plugin for seeing daily and weekly notes from this day in years past.
Auto Journal
3 years ago by Evan Bonsignori
Opinionated journaling automation like daily notes but with backfills for the days that you didn't open Obsidian.
Copy Metadata
3 years ago by wenlzhang
An Obsidian plugin to copy metadata to clipboard and insert it into file name.
Daily Note Pinner
3 years ago by LukeMT
Pins the daily note of the day and unpins other daily notes in Obsidian
Timestamp Link
3 years ago by wenlzhang
An Obsidian plugin to copy timestamped links to blocks, headings and notes.
Single File Daily Notes
3 years ago by Pranav Mangal
An Obsidian plugin to create and manage daily notes in a single file
Nested Daily Todos
3 years ago by Thomas Brezinski
A plugin for Obsidian will parse previous Daily Notes for incomplete todos and add them to today's Daily Note. It supports grouping the todos by section and supports alternative checkbox states and nested todos.
Daily note creator
3 years ago by Mario Holubar
Automatically creates missing daily notes.
Canvas Daily Note
3 years ago by Andrew McGivery
A plugin for Obsidian that allows you to add a daily note node to the canvas that will always show todays note.
Templated daily notes
3 years ago by digitorum
Allow to create templayted daily note in specific folder
Daily Note Navbar
2 years ago by Karsten Finderup Pedersen
Adds a daily note navbar to quickly navigate between sequential daily notes in Obsidian.
Telegram Inbox
2 years ago by icealtria
Receive messages from Telegram bots and add them to Obsidian's daily note.
Foodiary
2 years ago by vkostyanetsky
Food tracker plugin for Obsidian
Daily Prompt
2 years ago by Erl-koenig
Future Dates
2 years ago by Dmitry Manannikov
Update Time
2 years ago by Sébastien Dubois
Obsidian plugin that updates front matter to include creation and last update times
Memos Sync
2 years ago by RyoJerryYu
Syncing Memos to Obsidian daily note. Fully compatible with official Daily Notes plugin, Calendar plugin and Periodic Notes plugin.
Relative Timestamps
2 years ago by Charles Young
Daily Note Structure
2 years ago by db-developer
This obsidian plugin creates a structure for your daily notes
Front Matter Timestamps
2 years ago by LighthouseDino
Track note created and modified times in front matter, kept up to date automatically.
Everyday Classical Music
2 years ago by the flying markhor
Obsidian Plugin: Enhance your daily notes with the timeless elegance of classical music. Have a great day with the company of beautiful melodies!
Geulo
2 years ago by Junyoung Bang
Extension for pulling and syncing the videos that you liked in Youtube to Obsidian vault.
Daily Note Collector
2 years ago by Adar Butel
An Obsidian plugin that adds links to new notes to your daily note.
Calendar
6 years ago by Liam Cain
Simple calendar widget for Obsidian.
Review
6 years ago by ryanjamurphy
Add the current note to a future daily note to remember to review it.
Rollover Daily Todos
6 years ago by Matt Sessions
An obsidian plugin that rolls over todo items from the previous daily note
File path to URI
6 years ago by Michal Bureš
Convert file path to uri for easier use of links to local files outside of Obsidian
Things Logbook
6 years ago by Liam Cain
Sync your Things 3 Logbook with Obsidian
Advanced URI
5 years ago by Vinzent
Advanced modes for Obsidian URI
Daily Named Folder
5 years ago by Nemo Andrea
Like daily note, but nested in a daily folder and some more improvements
URI Commands
5 years ago by kzhovn
Execute URIs from the command palette
Update time on edit
5 years ago by beaussan
Nav Link Header
2 years ago by ahts4962
Display navigation links at the top of the notes in Obsidian
Youtube Iframe Timestamps
2 years ago by Nils Leo
Obsidian plugin to embed YouTube videos with clickable timestamps. Take video notes seamlessly without leaving your vault.
Open with Natural Language Dates
2 years ago by Charlie Chao
Quickly open a daily note using natural language. Requires "Natural Language Dates" plugin to work.
Daily notes calendar
2 years ago by bartkessels
Quickly navigate your vault using a calendar view, this plugin allows you to create and navigate to periodic notes and notes that are created on a specific date.
Discord Timestamps
2 years ago by Erika Gozar
Displays discord timestamps in read mode as they would appear in Discord.
Organized daily notes
2 years ago by duchangkim
Automatically organizes your daily notes into customizable folder structures for better organization and easier navigation.
Timecodes
a year ago by Kirill Gavrilov
Makes timecodes clickable, if there was a video URL mentioned earlier in Obsidian note
Task Mover
a year ago by Mariia Nebesnaia
A plugin for obsidian to move unfinished tasks to the daily note automatically
Previous Daily Note
a year ago by Marcos Talau
Plugin for Obsidian that opens the previous daily note
tidit
a year ago by codingthings.com
tidit is an Obsidian - https://obsidian.md - plugin that adds timestamps to your document as you type — when you want it, how you want it, where you want it.
Daily Note Metrics
a year ago by Andre-Diamond
Obsidian Plugin that parses Daily Notes and uses data to create charts
URI Converter
a year ago by wenlzhang
An Obsidian plugin to convert Obsidian URIs to Obsidian internal links.
Multiple Daily Notes
a year ago by Vab Kapoor
Obsidian plugin for adding multiple daily notes, with some extra configurations too.
Time Bullet
a year ago by pedrogdn
Wordflow Tracker
a year ago by LeCheenaX
Track the changes and stats of your edited note files automatically in Obsidian. Record the modified notes and statistics to your daily note with various customizations!
Pinned Daily Notes
a year ago by Jeremy Neiman
Dynamically update a pinned tab with today's daily note
Auto Daily Note
a year ago by John Dolittle
Daily Notes Automater
a year ago by David Pedrero
Limitless Lifelogs
a year ago by Maclean Dunkin
Sync your Limitless AI lifelog entries directly into Obsidian markdown files.
Inboxer
a year ago by Eoin Hurrell
Obsidian plugin to add an inbox to notes
Hledger Notes
a year ago by Boburmirzo Khamrakulov
Hledger Notes: Create and manage hledger entries directly in Obsidian Daily notes
Status.lol Publisher
a year ago by Eric Walker
Allows you to post to weblogs.lol, status.lol, some.pics and paste.lol from Obsidian.
Create Note with Date in This Directory
a year ago by Sangrak Choi
Obsidian plugin for creating a note with current date in this directory
Streams
a year ago by Floyd
Streams Obsidian Plugin
Coalesce
a year ago by Floyd
Coalesce is an Obsidian plugin that merges all your linked notes into a single, organized view for a cohesive research and writing experience.
Google Calendar Importer
10 months ago by Fan Li
A simple and light-weighted google calendar importer, allow injecting the events / tasks of a day automatically to your daily notes, or import it to anywhere with a command.
Time Inserter
10 months ago by heycalmdown
Obsidian plugin to insert current time at cursor position with exact or rounded formats
Open or Create File
10 months ago by Ilya Paripsa
Set up Obsidian commands that create or open files based on predefined patterns.
Timestamper
9 months ago by René Coignard
Insert the current timestamp into your notes.
Daily Notes Tweaks
9 months ago by René Coignard
Open a random daily note and automatically switch past daily notes to reading mode.
Status Bar Clock
7 months ago by Marty Ballard
Status Bar Clock for Obsidian
LongtimeDiary
5 months ago by sawamaru
This is Obsidian Plugin to show past DailyNotes on the same day in previous years.
Synaptic View
5 months ago by Yongmini
Obsidian Plugin : Synaptic View that unifies your dashboards, hub notes, quick-entry notes, periodic notes, web shortcuts, and calendar navigation—enable it as the default new-tab experience or summon it with a command.
Live Life Recording
a month ago by goryugocast
Operate tasks directly in Markdown with start/finish records, routine insertion, and a lightweight daily summary for Obsidian.
Day Planner
25 days ago by ivan-lednev
An Obsidian plugin for day planning with a clean UI and a simple task format
Browser Note
24 days ago by fengshuzi
Obsidian plugin: localhost HTTP API for vault notes with a built-in browser UI.
Journal View
18 days ago by RUverse
A Journal View for Obsidian
Thino
18 days ago by quorafind
A quick capture plugin for Obsidian, all data from your notes.
Floating Notes
17 days ago by haotiencheng
Floating popout window for instant note capture in Obsidian, inspired by Raycast Notes.
Granola Sync
17 days ago by tomelliot
Sync Granola notes to your Obsidian vault
Time Things
16 days ago by plasmabit
Know when your note was was last updated. Track how much time you spent writing. Keep an eye on the clock.
Dayframe
15 days ago by Ganessh Kumar R P
🖼️ like a picture frame but for your daily notes.
Pinned Tabs
15 days ago by NameIsKyro
Chrome-style compact pinned tabs for Obsidian with custom icons, smooth movement, and accidental-close protection.`
Mobile Sidebar Notes
14 days ago by ckep1
Open notes & new tabs in the sidebar on the Obsidian mobile app.
Today Alias
12 days ago by tanoshia
Plugin for Obsidian md editor. This hides a date prefix of any file name (in browser and tabs).