diff --git a/src/modal.ts b/src/modal.ts index 0fe7395..fde80a4 100644 --- a/src/modal.ts +++ b/src/modal.ts @@ -70,7 +70,12 @@ export class CreateNoteModal extends Modal { --- `; // Create the MD File and close the modal - await createNewMarkdownFile(this.plugin, defFolder, newFileName, defaultNewFileText); + await createNewMarkdownFile( + this.plugin, + defFolder, + newFileName, + this.plugin.settings.dateSource === 'yaml' ? defaultNewFileText : '' + ); thisModal.close(); } else { new Notice('Folder couldnt be found in the Vault'); diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 354eaa2..2a6570f 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -185,6 +185,15 @@ export class OZCalendarPluginSettingsTab extends PluginSettingTab { containerEl.createEl('h2', { text: 'New Note Settings' }); + containerEl.createEl('p', { + text: ` + The plugin will add the YAML key and date to the newly created note using the date format provided above + if Date Source is YAML. However, auto YAML key generation for the notes is going to be disabled if you use + File Name as date source. + `, + cls: 'setting-item-description', + }); + new Setting(this.containerEl) .setName('Default Folder Location') .setDesc('Select the default folder, under which the new files should be saved when use plugin + icon')