mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-30 03:16:25 +02:00
feat: allow future dates for Google Calendar and Luma connectors
- Updated date handling in indexing functions to permit future dates for Google Calendar and Luma connectors. - Enhanced UI components to support future date selection, including a new button for selecting the next 30 days. - Adjusted documentation and descriptions to clarify date range options for users.
This commit is contained in:
parent
1b4ec2daa7
commit
4aeb05e2e5
7 changed files with 80 additions and 39 deletions
|
|
@ -541,7 +541,7 @@ async def index_connector_content(
|
|||
),
|
||||
end_date: str = Query(
|
||||
None,
|
||||
description="End date for indexing (YYYY-MM-DD format). If not provided, uses today's date",
|
||||
description="End date for indexing (YYYY-MM-DD format). If not provided, uses today's date. For calendar connectors (Google Calendar, Luma), future dates can be selected to index upcoming events.",
|
||||
),
|
||||
drive_items: GoogleDriveIndexRequest | None = Body(
|
||||
None,
|
||||
|
|
@ -614,7 +614,19 @@ async def index_connector_content(
|
|||
else:
|
||||
indexing_from = start_date
|
||||
|
||||
indexing_to = end_date if end_date else today_str
|
||||
# For calendar connectors, default to today but allow future dates if explicitly provided
|
||||
if connector.connector_type in [
|
||||
SearchSourceConnectorType.GOOGLE_CALENDAR_CONNECTOR,
|
||||
SearchSourceConnectorType.LUMA_CONNECTOR,
|
||||
]:
|
||||
# Default to today if no end_date provided (users can manually select future dates)
|
||||
if end_date is None:
|
||||
indexing_to = today_str
|
||||
else:
|
||||
indexing_to = end_date
|
||||
else:
|
||||
# For non-calendar connectors, cap at today
|
||||
indexing_to = end_date if end_date else today_str
|
||||
|
||||
if connector.connector_type == SearchSourceConnectorType.SLACK_CONNECTOR:
|
||||
from app.tasks.celery_tasks.connector_tasks import (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue