a
    ÛEb'  ã                	   @   sš   d dl Z d dlZd dlmZ d dlmZmZ d dlmZm	Z	 e	dddƒe	dd	dƒe	d
ddƒe	dddƒe	dddƒe	dddƒdœZ
dZddd„Zddd„ZdS )é    N)Úavoid_wrapping)Úis_awareÚutc)ÚgettextÚngettext_lazyz%(num)d yearz%(num)d yearsÚnumz%(num)d monthz%(num)d monthsz%(num)d weekz%(num)d weeksz%(num)d dayz%(num)d daysz%(num)d hourz%(num)d hoursz%(num)d minutez%(num)d minutes)ÚyearÚmonthÚweekÚdayÚhourÚminute))i€3ár   )i �' r	   )i€:	 r
   )i€Q r   )i  r   )é<   r   Fé   c                 C   sæ  |du rt }|dkrtdƒ‚t| tjƒs<t | j| j| j¡} |r`t|tjƒs`t |j|j|j¡}|pztj t| ƒrvt	nd¡}|rŠ||  } }||  }t
 | j|j¡}|dkrÔt
 | j¡rÀ|d8 }nt
 |j¡rÔ|d7 }|t |¡8 }|jd d d |j }|dk�rt|d ddi ƒS ttƒD ]&\}\}	}
||	 }|dk�r  �q\�q t|d ddi ƒS g }d}|ttƒk �rØ||k �rØt| \}	}
||	 }|dk�rž�qØ| t||
 d|i ƒ¡ ||	| 8 }|d7 }|d7 }�qdtd	ƒ |¡S )
a  
    Take two datetime objects and return the time between d and now as a nicely
    formatted string, e.g. "10 minutes". If d occurs after now, return
    "0 minutes".

    Units used are years, months, weeks, days, hours, and minutes.
    Seconds and microseconds are ignored. Up to `depth` adjacent units will be
    displayed.  For example, "2 weeks, 3 days" and "1 year, 3 months" are
    possible outputs, but "2 weeks, 3 hours" and "1 year, 5 days" are not.

    `time_strings` is an optional dict of strings to replace the default
    TIME_STRINGS dict.

    `depth` is an optional integer to control the number of adjacent time
    units returned.

    Adapted from
    https://web.archive.org/web/20060617175230/http://blog.natbat.co.uk/archive/2003/Jun/14/time_since
    Nr   zdepth must be greater than 0.é   é   r   r   r   z, )ÚTIME_STRINGSÚ
ValueErrorÚ
isinstanceÚdatetimer   r	   r   Únowr   r   ÚcalendarÚleapdaysÚisleapÚ	timedeltaÚdaysÚsecondsr   Ú	enumerateÚTIMESINCE_CHUNKSÚlenÚappendr   Újoin)Údr   ÚreversedÚtime_stringsÚdepthÚdeltar   ZsinceÚir   ÚnameÚcountÚresultZcurrent_depth© r+   úV/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/django/utils/timesince.pyÚ	timesince   sN    





r-   c                 C   s   t | |d||d�S )zV
    Like timesince, but return a string measuring the time until the given time.
    T)r#   r$   r%   )r-   )r"   r   r$   r%   r+   r+   r,   Ú	timeuntila   s    r.   )NFNr   )NNr   )r   r   Zdjango.utils.htmlr   Zdjango.utils.timezoner   r   Zdjango.utils.translationr   r   r   r   r-   r.   r+   r+   r+   r,   Ú<module>   s   





ú	

F