@@ -3,7 +3,13 @@ import { addIcon, App, Plugin } from "obsidian";
33
44import { getCommands , openPeriodicNote , periodConfigs } from "./commands" ;
55import { SETTINGS_UPDATED } from "./events" ;
6- import { calendarDayIcon , calendarMonthIcon , calendarWeekIcon } from "./icons" ;
6+ import {
7+ calendarDayIcon ,
8+ calendarMonthIcon ,
9+ calendarWeekIcon ,
10+ calendarQuarterIcon ,
11+ calendarYearIcon ,
12+ } from "./icons" ;
713import { showFileMenu } from "./modal" ;
814import {
915 DEFAULT_SETTINGS ,
@@ -43,6 +49,8 @@ export default class PeriodicNotesPlugin extends Plugin {
4349 addIcon ( "calendar-day" , calendarDayIcon ) ;
4450 addIcon ( "calendar-week" , calendarWeekIcon ) ;
4551 addIcon ( "calendar-month" , calendarMonthIcon ) ;
52+ addIcon ( "calendar-quarter" , calendarQuarterIcon ) ;
53+ addIcon ( "calendar-year" , calendarYearIcon ) ;
4654 }
4755
4856 onLayoutReady ( ) : void {
@@ -71,9 +79,13 @@ export default class PeriodicNotesPlugin extends Plugin {
7179 private configureRibbonIcons ( ) {
7280 this . ribbonEl ?. detach ( ) ;
7381
74- const configuredPeriodicities = [ "daily" , "weekly" , "monthly" ] . filter (
75- ( periodicity ) => this . settings [ periodicity ] . enabled
76- ) ;
82+ const configuredPeriodicities = [
83+ "daily" ,
84+ "weekly" ,
85+ "monthly" ,
86+ "quarterly" ,
87+ "yearly" ,
88+ ] . filter ( ( periodicity ) => this . settings [ periodicity ] . enabled ) ;
7789
7890 if ( configuredPeriodicities . length ) {
7991 const periodicity = configuredPeriodicities [ 0 ] as IPeriodicity ;
@@ -96,7 +108,7 @@ export default class PeriodicNotesPlugin extends Plugin {
96108
97109 private configureCommands ( ) {
98110 // Remove disabled commands
99- [ "daily" , "weekly" , "monthly" ]
111+ [ "daily" , "weekly" , "monthly" , "quarterly" , "yearly" ]
100112 . filter ( ( periodicity ) => ! this . settings [ periodicity ] . enabled )
101113 . forEach ( ( periodicity : IPeriodicity ) => {
102114 getCommands ( periodicity ) . forEach ( ( command ) =>
@@ -108,7 +120,7 @@ export default class PeriodicNotesPlugin extends Plugin {
108120 } ) ;
109121
110122 // register enabled commands
111- [ "daily" , "weekly" , "monthly" ]
123+ [ "daily" , "weekly" , "monthly" , "quarterly" , "yearly" ]
112124 . filter ( ( periodicity ) => this . settings [ periodicity ] . enabled )
113125 . forEach ( ( periodicity : IPeriodicity ) => {
114126 getCommands ( periodicity ) . forEach ( this . addCommand . bind ( this ) ) ;
@@ -132,6 +144,8 @@ export default class PeriodicNotesPlugin extends Plugin {
132144 daily : { ...DEFAULT_SETTINGS } ,
133145 weekly : { ...DEFAULT_SETTINGS } ,
134146 monthly : { ...DEFAULT_SETTINGS } ,
147+ quarterly : { ...DEFAULT_SETTINGS } ,
148+ yearly : { ...DEFAULT_SETTINGS } ,
135149 } ,
136150 settings || { }
137151 ) ;
0 commit comments