From c1cec32d9e723427029c7a1bdde9d34e2a73c0c0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 20 Jan 2025 18:46:30 +1100 Subject: [PATCH] feat: use all available time zone names in CurrentDateComponent (#5797) Co-authored-by: Edwin Jose --- .../components/helpers/current_date.py | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/src/backend/base/langflow/components/helpers/current_date.py b/src/backend/base/langflow/components/helpers/current_date.py index 6d7b4508c..951176dd6 100644 --- a/src/backend/base/langflow/components/helpers/current_date.py +++ b/src/backend/base/langflow/components/helpers/current_date.py @@ -1,5 +1,5 @@ from datetime import datetime -from zoneinfo import ZoneInfo +from zoneinfo import ZoneInfo, available_timezones from loguru import logger @@ -18,41 +18,7 @@ class CurrentDateComponent(Component): DropdownInput( name="timezone", display_name="Timezone", - options=[ - "UTC", - "US/Eastern", - "US/Central", - "US/Mountain", - "US/Pacific", - "Europe/London", - "Europe/Paris", - "Europe/Berlin", - "Europe/Moscow", - "Asia/Tokyo", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Dubai", - "Australia/Sydney", - "Australia/Melbourne", - "Pacific/Auckland", - "America/Sao_Paulo", - "America/Mexico_City", - "America/Toronto", - "America/Vancouver", - "Africa/Cairo", - "Africa/Johannesburg", - "Atlantic/Reykjavik", - "Indian/Maldives", - "America/Bogota", - "America/Lima", - "America/Santiago", - "America/Buenos_Aires", - "America/Caracas", - "America/La_Paz", - "America/Montevideo", - "America/Asuncion", - "America/Cuiaba", - ], + options=list(available_timezones()), value="UTC", info="Select the timezone for the current date and time.", tool_mode=True,