Final working solution: shadcn date picker with timezone fix

- Implemented shadcn/ui date picker with Czech localization
- Added month/year dropdown navigation for easy date selection
- Fixed critical timezone bug causing "No valid days found" error
  - Changed from toISOString() to local date formatting
  - Dates now correctly sent as 2025-01-01 instead of 2024-12-31
- Calendar auto-closes after date selection
- All features tested and working:
  - Journey calculation with correct date ranges
  - "Vyplnit na web" button visible and functional
  - Excel export working
  - Backend successfully processes January 2025 data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Docker Config Backup
2025-10-13 07:45:06 +02:00
parent ffdfac65de
commit b38452413d
22 changed files with 2612 additions and 653 deletions

View File

@@ -91,12 +91,14 @@ async def scrape_journeybook(request: ScrapeRequest):
async def calculate_kilometers(request: CalculateRequest):
"""Scrape data, filter sick days, and recalculate kilometers"""
try:
logger.info(f"Calculate request: start_date={request.start_date}, end_date={request.end_date}")
attendance_scraper = AttendanceScraper(request.username, request.password)
journeybook_scraper = JourneybookScraper(request.username, request.password, request.vehicle_registration)
# Get all months in the date range
start = datetime.strptime(request.start_date, "%Y-%m-%d")
end = datetime.strptime(request.end_date, "%Y-%m-%d")
logger.info(f"Parsed dates: start={start}, end={end}")
# Collect data from all months
all_attendance_dates = []