U
    Sh                  
   @   sv  d dl mZmZ d dlZd dlZd dlmZ d dlmZ e  e	dZ
e
se	ddZe	dd	Ze	d
dZe	ddZe	ddZde de de de de 
Z
ee
Zed e ZeedZe Zer`ed  r`ed  Zede  de Zede  ede  ee ed ed ed ed ede  ned W 5 Q R X dS )     )create_enginetextN)load_dotenv)dateDATABASE_URLDB_HOSTZ	localhostDB_PORTZ5432DB_NAMEZtimesheet_dbDB_USERZpostgresDB_PASSWORD zpostgresql://:@/z,=== Opening Dashboard with Correct Date ===
zq
        SELECT MAX(DATE(timestamp)) as latest_date
        FROM activity_records
        WHERE duration > 0
    zLatest date with data: zhttp://localhost:5001/?date=z
Opening dashboard with date: zURL: uA   
✅ Dashboard should open in your browser with the correct date!z"
If it doesn't work automatically:z1. Go to http://localhost:5001z$2. Click the date picker (top-right)z3. Select: u   ❌ No data found in database!)Z
sqlalchemyr   r   osZ
webbrowserZdotenvr   Zdatetimer   getenvr   r   r   r	   r
   r   ZengineprintZconnectZconnZexecuteresultZfetchonerowZlatest_dateZdashboard_urlopen r   r   ./open_dashboard_with_data.py<module>   s>   
"


