kzilla
04/27/2022, 3:20 PMkzilla
04/27/2022, 3:35 PMhikchoi
04/27/2022, 3:46 PMCreate Note With Custom Trait
to create a monthly journal.hikchoi
04/27/2022, 3:46 PMhikchoi
04/27/2022, 3:49 PMDendron: Register Note Trait
and paste this into the file. I called the custom trait monthly-journal
.
js
/**
* 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");
return {
name: ["daily", "journal", year, month].join('.'),
promptUserForModification: true
};
}
},
/**
* Specify behavior for altering the title of the note when it is created.
*/
OnCreate: {
setTitle(props) {
const curDate = new Date();
const month = curDate.toLocaleString('default', { month: 'long' });
return month;
}
}
}
hikchoi
04/27/2022, 3:55 PMkeybindings.json
doesn't work in VSCode.kzilla
04/27/2022, 7:12 PM