docs: def calendar_data(self, request):
          """
          Return event data in JSON format for AJAX requests, or a calendar page
          to be loaded in an iframe.
          """
  
          # mutable copy
          request.GET = request.GET.copy()
  
          if 'timezone' in request.GET:
              tz = djtz.get(request.GET.pop('timezone'))
          else:
              tz = get_current_timezone()
  
          if 'start' in request.GET:
              start_dt = self._parse_dt_from_request(request, 'start')
              if start_dt:
                  start = djtz.localize(start_dt, tz)
              else:
                  start = None
          else:
              start = None
          if 'end' in request.GET:
              end_dt = self._parse_dt_from_request(request, 'end')
              if end_dt:
                  end = djtz.localize(end_dt, tz)
              else:
                  end = None
          else:
              end = None
  
          # filter the qs like the changelist filters
          cl = ChangeList(request, self.model, self.list_display,
                          self.list_display_links, self.list_filter,
                          self.date_hierarchy, self.search_fields,
                          self.list_select_related, self.list_per_page,
                          self.list_max_show_all, self.list_editable, self)
  
          filtered_event_ids = cl.get_queryset(request).values_list('id', flat=True)
          all_occurrences = models.Occurrence.objects.filter(event__id__in=filtered_event_ids).overlapping(start, end)
  
          data = []
          for occurrence in all_occurrences.all():
              data.append(self._calendar_json_for_occurrence(occurrence))
          data = json.dumps(data, cls=DjangoJSONEncoder)
          return HttpResponse(content=data, content_type='application/json')