From e5b641ce31703b3af0238ff93645fcfa9a3f9168 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 17 Dec 2023 22:32:22 -0500 Subject: small change to calendarView to render calendars --- .../views/collections/CollectionCalendarView.tsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionCalendarView.tsx b/src/client/views/collections/CollectionCalendarView.tsx index ad880b815..2cec29669 100644 --- a/src/client/views/collections/CollectionCalendarView.tsx +++ b/src/client/views/collections/CollectionCalendarView.tsx @@ -39,17 +39,13 @@ export class CollectionCalendarView extends CollectionSubView() { _stackRef = React.createRef(); panelHeight = () => { - return 0; // TODO: change - }; - - panelWidth = () => { - return 0; // TODO: change + return this._props.PanelHeight() - 40; // this should be the height of the stacking view. For now, it's the hieight of the calendar view minus 40 to allow for a title }; // most recent calendar should come first sortByMostRecentDate = (calendarA: Doc, calendarB: Doc) => { - const aDateRangeStr = StrCast(calendarA.date_range); - const bDateRangeStr = StrCast(calendarB.date_range); + const aDateRangeStr = StrCast(DocListCast(calendarA.data).lastElement()?.date_range); + const bDateRangeStr = StrCast(DocListCast(calendarB.data).lastElement()?.date_range); const [aFromDate, aToDate] = dateRangeStrToDates(aDateRangeStr); const [bFromDate, bToDate] = dateRangeStrToDates(bDateRangeStr); @@ -77,24 +73,23 @@ export class CollectionCalendarView extends CollectionSubView() { .scale(this._props.NativeDimScaling?.() || 1); get calendarsKey() { - return this._props.fieldKey + '_calendars'; + return this._props.fieldKey; } render() { return ( -
+
); -- cgit v1.2.3-70-g09d2