o
    o’wh_  ã                   @   s    d dl m Z mZmZ dd„ ZdS )é    )ÚdatetimeÚtimeÚ	timedeltac                 C   sÜ   |  ¡ }|  ¡ }t| Ž }t|Ž }t ||¡}t ||¡}	t ||¡}
t ||¡}d}||	krK||krKt||ƒ}t||	ƒ}||  ¡ d }|td|ƒ7 }||krl||
krlt||
ƒ}t||ƒ}||  ¡ d }|td|ƒ7 }|S )Nr   é<   )Údater   r   ÚcombineÚmaxÚminÚtotal_seconds)Ú
start_timeÚend_timeÚ	datetime1Ú	datetime2Údate1Údate2Ústart_time_objÚend_time_objÚ
day_start1Úday_end1Ú
day_start2Úday_end2Útotal_minutesÚoverlap_startÚoverlap_endÚoverlap_duration© r   ú5/var/www/html/DRIVERZZ_CUSTOMER_APIS/trips/helpers.pyÚtotal_daytime_minutes   s(   



r   N)r   r   r   r   r   r   r   r   Ú<module>   s    