argenos / nldates-obsidian

Work with dates in natural language in Obsidian
MIT License
490 stars 44 forks source link

Need to access suggestions programatically #67

Closed NikhilSaini38 closed 2 years ago

NikhilSaini38 commented 2 years ago

I am trying to implement nldates suggestions in quickadd suggester via user scripts. is it possible to expose nldates suggester in API?

liamcain commented 2 years ago

There's some information about how to access the natural language parser programmatically here: https://github.com/argenos/nldates-obsidian#for-developers. It won't generate the suggestion list, but you can probably replicate the list with something like this: https://github.com/argenos/nldates-obsidian/blob/fd06ef1646eb8e29f1887e872248549dc27cb5af/src/suggest/date-suggest.ts#L49