diff --git a/manifest-beta.json b/manifest-beta.json index 07a7ef3..e203914 100644 --- a/manifest-beta.json +++ b/manifest-beta.json @@ -1,7 +1,7 @@ { "id": "chronology", "name": "Chronology", - "version": "1.1.9", + "version": "1.1.10", "minAppVersion": "0.15.0", "description": "Enables to have a calendat and a timeline of the activities", "author": "Gabriele Cannata", diff --git a/manifest.json b/manifest.json index c203fbc..b7b7ab5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "chronology", "name": "Chronology", - "version": "1.1.9", + "version": "1.1.10", "minAppVersion": "0.15.0", "description": "Provides a calendar and a timeline of the notes creation and modification", "author": "Gabriele Cannata", diff --git a/package.json b/package.json index 879b8bc..ba67055 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-chronologyn", - "version": "1.1.9", + "version": "1.1.10", "description": "Obsidian.md plugin that Provides a calendar and a timeline of the notes creation and modification", "main": "main.js", "scripts": { diff --git a/src/ChronologySettingTab.ts b/src/ChronologySettingTab.ts index cfc70f3..f4c384a 100644 --- a/src/ChronologySettingTab.ts +++ b/src/ChronologySettingTab.ts @@ -121,6 +121,11 @@ export class ChronologySettingTab extends PluginSettingTab { }) }) + // add seting for computeHeat + this.createToggle(containerEl, "Compute Heat", + "Compute heat for each day in the calendar", + "computeHeat" + ); } diff --git a/src/TimeIndex.ts b/src/TimeIndex.ts index f8d6646..469ddf8 100644 --- a/src/TimeIndex.ts +++ b/src/TimeIndex.ts @@ -41,7 +41,6 @@ export class TimeIndex implements ITimeIndex { getNotesForCalendarItem(item: CalendarItem, sortingStrategy = SortingStrategy.Mixed, desc = true): NoteAttributes[] { const allNotes = this.app.vault.getMarkdownFiles(); const { fromTime, toTime } = item.getTimeRange(); - let notes = allNotes.reduce((acc, note) => { let createdTime = moment(note.stat.ctime); let modifiedTime = moment(note.stat.mtime); @@ -161,8 +160,10 @@ export class TimeIndex implements ITimeIndex { getHeatForDate(date: string | moment.Moment): number { + if(!getChronologySettings().computeHeat) return 0; const mom = moment(date); + const items = this.getNotesForCalendarItem(new CalendarItem(mom)); // this formula is logaritmic diff --git a/src/main.ts b/src/main.ts index 3225b50..e848748 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,6 +14,7 @@ interface ChronologyPluginSettings { firstDayOfWeek: number; creationDateAttribute?: string; modifiedDateAttribute?: string; + computeHeat?: boolean; } const DEFAULT_SETTINGS: ChronologyPluginSettings = { @@ -25,7 +26,8 @@ const DEFAULT_SETTINGS: ChronologyPluginSettings = { groupItemsInSameSlot: false, firstDayOfWeek: -1, // locale default creationDateAttribute: "", - modifiedDateAttribute: "" + modifiedDateAttribute: "", + computeHeat: true } let expSettings: ChronologyPluginSettings;