feat: Use local timezone for scheduled cleanup instead of UTC

The scheduler now uses the timezone configured in .env (TZ variable)
instead of hardcoded UTC:
- Add get_local_timezone_name() helper to manager.py
- BackgroundScheduler uses system local timezone
- API returns timezone field in cleanup-settings response
- Frontend displays timezone next to hour selector and in status text
- Updated documentation to reflect timezone behavior

This makes the cleanup hour more intuitive for users in non-UTC timezones.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-25 10:46:08 +01:00
parent da31ab8794
commit a4ef0fd497
5 changed files with 106 additions and 47 deletions
+3 -3
View File
@@ -284,13 +284,13 @@ The advanced cleanup tool allows you to filter and remove contacts based on mult
### Automatic Contact Cleanup
You can schedule automatic cleanup to run daily at a specified hour (UTC):
You can schedule automatic cleanup to run daily at a specified hour:
1. Navigate to **Contact Management** page
2. Expand **Advanced Filters** section
3. Configure your filter criteria (types, date field, days of inactivity)
4. Toggle **Enable Auto-Cleanup** switch
5. Select the hour (UTC) when cleanup should run
5. Select the hour when cleanup should run
**Requirements for enabling auto-cleanup:**
- "Days of Inactivity" must be set to a value greater than 0
@@ -299,7 +299,7 @@ You can schedule automatic cleanup to run daily at a specified hour (UTC):
**Notes:**
- Protected contacts are never deleted by auto-cleanup
- Filter criteria changes are auto-saved when auto-cleanup is enabled
- The scheduler runs in UTC timezone
- The scheduler uses the timezone configured in `.env` file (`TZ` variable, e.g., `TZ=Europe/Warsaw`)
---