Thanks to @shabegom (author) and my unusual use case, this dataview script was born.
As the title says, you need the 5 plugins installed and enabled for this to work.
```dataviewjs
const {createButton} = app.plugins.plugins["buttons"]
const {update} = app.plugins.plugins['metaedit'].api
const defer = async (file, key) => {
const value = await app.plugins.plugins['templater-obsidian'].templater.functions_generator.internal_functions.modules_array[4].static_functions.get('prompt')("What Date")
const date = app.plugins.plugins['nldates-obsidian'].parseDate(value).moment.format("YYYY-MM-DD")
await update(key, date, file)
}
dv.table(
["Name", "Date", "Bouton"],
dv.pages("#task").map(t => [t.file.link, t['date'],
createButton({app, el: this.container, args: {name: "Change date"}, clickOverride: {click: defer, params: [t.file.path, 'date']}})])
)
```
With this, you can update date metadata in notes using natural language (without leaving the current note) by clicking on buttons in a dataview table
What we’ve got here is a mashup of 5 different plugins
- Dataview renders the table
- Buttons puts a button in the table
- When a button is clicked, Templater renders a prompt for a date
- Natural Language dates takes the prompt input and formats as an actual date
- Meta edit updates the YAML of the specified note with the date
Special thanks to @AB1908 for reminding me to post this here, so that it doesn’t get lost in discord.