argenos / nldates-obsidian

Work with dates in natural language in Obsidian
MIT License
497 stars 46 forks source link

Erroneous sample usage in readme #34

Closed ghost closed 3 years ago

ghost commented 3 years ago

Current sample usage is out of date, what currently works:

const internalPlugins = (app as any).internalPlugins.app.plugins.plugins;
const nldatesPlugin = internalPlugins["nldates-obsidian"];
const parsedResult = nldatesPlugin.parseDate("next year");
console.log(parsedResult.moment.format("YYYY")); // This should return 2022
argenos commented 3 years ago

I can still get the plugin using this.app.plugins.getPlugin('nldates-obsidian'). In which context are you using this?

ghost commented 3 years ago

I can still get the plugin using this.app.plugins.getPlugin('nldates-obsidian'). In which context are you using this?

I cloned the example plugin and pasted the sample in the settings tab constructor just to see if it worked, I'm on windows if it matters

argenos commented 3 years ago

I am not sure if you'll be able to access everything from the constructor, is there any reason why you'd need to parse the date there?