muteboy
05/26/2022, 9:50 AMJoshi
05/26/2022, 10:17 AMCreate Note With Custom Trait
to create a meeting note.
Quickstart for custom note traits: https://wiki.dendron.so/notes/EQoaBI8A0ZcswKQC3UMpO/
Here's a quick note trait I wrote. You can run Dendron: Register Note Trait
and paste this into the file. I called the custom trait meeting-note.
/**
* Note: you must reload your window after each file change for it to take into
* effect. We are working to improve this behavior.
*/
module.exports = {
/**
* Specify behavior to modify the name of the note. If
* promptUserForModification is true, the modified name will appear in a
* lookup control to allow the user to further edit the note name before
* confirming.
*/
OnWillCreate: {
setNameModifier(props) {
const curDate = new Date();
const year = curDate.getFullYear();
const month = String(curDate.getMonth() + 1).padStart(2, "0");
const date = String(curDate.getDate());
return {
name: ["meet",year,month,date].join('.'),
promptUserForModification: true
};
}
},
/**
* Specify behavior for altering the title of the note when it is created.
*/
OnCreate: {
setTitle(props) {
const curDate = new Date();
const year = curDate.getFullYear();
const month = String(curDate.getMonth() + 1).padStart(2, "0");
const date = String(curDate.getDate());
const title = [year,month,date].join('-');
return title;
}
}
}
Joshi
05/26/2022, 10:44 AMCreate Note With Custom Trait
command to create notes. The instructions to add the custom traits are the same as above, you can use something like the below snippet to alter the title
/**
* Note: you must reload your window after each file change for it to take into
* effect. We are working to improve this behavior.
*/
module.exports = {
/**
* Specify behavior for altering the title of the note when it is created.
*/
OnCreate: {
setTitle(props) {
const curDate = new Date();
const year = curDate.getFullYear();
const month = String(curDate.getMonth() + 1).padStart(2, "0");
const date = String(curDate.getDate());
const title = [year,month,date].join('-');
return title;
}
}
}