diff --git a/src/public/app/widgets/view_widgets/calendar_view.ts b/src/public/app/widgets/view_widgets/calendar_view.ts
index 5510f0412..3ce0a90e3 100644
--- a/src/public/app/widgets/view_widgets/calendar_view.ts
+++ b/src/public/app/widgets/view_widgets/calendar_view.ts
@@ -138,7 +138,7 @@ export default class CalendarView extends ViewMode {
// Promoted attributes
if (promotedAttributes) {
- for (const [name, value] of Object.entries(promotedAttributes)) {
+ for (const [name, value] of promotedAttributes) {
html += `\
${name}: ${value}
@@ -353,7 +353,7 @@ export default class CalendarView extends ViewMode {
const events: EventInput[] = [];
const calendarDisplayedAttributes = note.getLabelValue("calendar:displayedAttributes")?.split(",");
- let displayedAttributesData = null;
+ let displayedAttributesData: Array<[string, string]> | null = null;
if (calendarDisplayedAttributes) {
displayedAttributesData = await this.#buildDisplayedAttributes(note, calendarDisplayedAttributes);
}
@@ -380,11 +380,11 @@ export default class CalendarView extends ViewMode {
static async #buildDisplayedAttributes(note: FNote, calendarDisplayedAttributes: string[]) {
const filteredDisplayedAttributes = note.getAttributes().filter((attr): boolean => calendarDisplayedAttributes.includes(attr.name))
- const result: Record = {};
+ const result: Array<[string, string]> = [];
for (const attribute of filteredDisplayedAttributes) {
- if (attribute.type === "label") result[attribute.name] = attribute.value;
- else result[attribute.name] = (await attribute.getTargetNote())?.title || ""
+ if (attribute.type === "label") result.push([attribute.name, attribute.value]);
+ else result.push([attribute.name, (await attribute.getTargetNote())?.title || ""])
}
return result;