diff --git a/data.json b/data.json index 5abed0b..39c4ca8 100644 --- a/data.json +++ b/data.json @@ -17,6 +17,7 @@ "today": "today", "tomorrow": "tomorrow", "in two days": "in two days", - "next week": "next week" + "next week": "next week", + "in two weeks": "in two weeks" } } \ No newline at end of file diff --git a/src/views/settings-tab.ts b/src/views/settings-tab.ts index 57e995c..47820a4 100644 --- a/src/views/settings-tab.ts +++ b/src/views/settings-tab.ts @@ -122,9 +122,9 @@ export class IWSettingsTab extends PluginSettingTab { return; } - const validDates = inputDates - .filter(([_, date]) => date != null && date.date) - .map(([s, _]) => s); + const validDates: string[] = inputDates + .filter(([_, date]: [string, any]) => date != null && date.date) + .map(([s, _]: [string, Date]) => s); if (inputDates.length !== validDates.length) { LogTo.Debug( @@ -134,13 +134,13 @@ export class IWSettingsTab extends PluginSettingTab { ); } - const dateOptionsRecord: Record< - string, - string - > = validDates.reduce( - (acc: Record, x: string) => (acc[x] = x), - {} - ); + const dateOptionsRecord: Record = validDates + .reduce((acc, x) => + { + acc[x] = x; + return acc; + }, {} as Record); + LogTo.Debug( "Setting dropdown date options to " + JSON.stringify(dateOptionsRecord)