diff options
| author | aaravkumar <aarav.kumar1510@gmail.com> | 2025-04-30 22:54:16 -0400 |
|---|---|---|
| committer | aaravkumar <aarav.kumar1510@gmail.com> | 2025-04-30 22:54:16 -0400 |
| commit | 54b8c7e9ec258fd43ec523aaf3d967a646022cee (patch) | |
| tree | 740465370ed13a46dbfa30aebfbe2d48a321e993 /src/client/views/nodes/calendarBox/CalendarBox.tsx | |
| parent | 72d7414b9851bcc3d415605ce421c0572278a900 (diff) | |
made document options as data doc options ($), and fixed namign conventions
Diffstat (limited to 'src/client/views/nodes/calendarBox/CalendarBox.tsx')
| -rw-r--r-- | src/client/views/nodes/calendarBox/CalendarBox.tsx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/client/views/nodes/calendarBox/CalendarBox.tsx b/src/client/views/nodes/calendarBox/CalendarBox.tsx index ce58ac9fa..bebd86ac2 100644 --- a/src/client/views/nodes/calendarBox/CalendarBox.tsx +++ b/src/client/views/nodes/calendarBox/CalendarBox.tsx @@ -68,7 +68,7 @@ export class CalendarBox extends CollectionSubView() { @computed get calendarEvents(): EventSourceInput | undefined { return this.childDocs.map(doc => { const { start, end } = dateRangeStrToDates(StrCast(doc.date_range)); - const isCompleted = BoolCast(doc.completed); // AARAV ADD + const isCompleted = BoolCast(doc.$completed); // AARAV ADD return { title: StrCast(doc.title), start, @@ -76,7 +76,7 @@ export class CalendarBox extends CollectionSubView() { groupId: doc[Id], startEditable: true, endEditable: true, - allDay: BoolCast(doc.allDay), + allDay: BoolCast(doc.$allDay), classNames: ['mother', isCompleted ? 'completed-task' : ''], // will determine the style editable: true, // subject to change in the future backgroundColor: this.eventToColor(doc), @@ -143,16 +143,16 @@ export class CalendarBox extends CollectionSubView() { doc.date_range = `${startDate.toISOString()}|${endDate.toISOString()}`; const allDayStatus = arg.event.allDay ?? false; - if (doc.allDay !== allDayStatus) { - doc.allDay = allDayStatus; + if (doc.$allDay !== allDayStatus) { + doc.$allDay = allDayStatus; } - if (doc.allDay) { - delete doc.startTime; - delete doc.endTime; + if (doc.$allDay) { + delete doc.$startTime; + delete doc.$endTime; } else { - doc.startTime = new DateField(startDate); - doc.endTime = new DateField(endDate); + doc.$startTime = new DateField(startDate); + doc.$endTime = new DateField(endDate); } }; @@ -206,7 +206,7 @@ export class CalendarBox extends CollectionSubView() { if (doc.type === 'task') { const checkButton = document.createElement('button'); - checkButton.innerText = doc.completed ? '✅' : '⬜'; + checkButton.innerText = doc.$completed ? '✅' : '⬜'; checkButton.style.position = 'absolute'; checkButton.style.right = '5px'; checkButton.style.top = '50%'; @@ -221,7 +221,7 @@ export class CalendarBox extends CollectionSubView() { checkButton.onclick = ev => { ev.stopPropagation(); - doc.completed = !doc.completed; + doc.$completed = !doc.$completed; this._calendar?.refetchEvents(); }; |
