Dear NA,

I accomplished this with numpy. How can I get the value (difference between
the two dates) when I select the second date for example in the text field?
I know Javascript  can be used but how?

On Tue, 15 Jun 2021 at 11:14, Nikeet NA <[email protected]> wrote:

> You need to loop through the dates maintain a count variable get the
> weekday for every datetime object with date.weekday() exclude as per your
> need for days you dont want to count.
>
> On Tuesday, 15 June 2021 at 11:30:21 UTC+5:30 [email protected] wrote:
>
>> Team,
>>
>> I have date1 and date2 fields. I am able to calculate number of days
>> between the two dates using relativedelta as shown below:
>>
>> date1 = datetime.datetime.strptime(str(end_date), '%Y-%m-%d')
>> date2 = datetime.datetime.strptime(str(start_date), '%Y-%m-%d')
>> r = relativedelta.relativedelta(date1, date2)
>> n_days=r.days
>> What I want now is calculating the days but excluding weekends days.
>> Again I want to pick the second date and get the number of days
>> (date2-date1) in the text field directly.
>>
>> Please help.
>>
>> Thanks
>> --
>> *Eugene*
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/16ba7533-93ba-4925-9f93-e430d7128342n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/16ba7533-93ba-4925-9f93-e430d7128342n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
*TUYIZERE Eugene*



*Msc Degree in Mathematical Science*

*African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
Garden-Lime, Cameroon*

Bsc in Computer Science

*UR-Nyagatare Campus*

Email: [email protected]
           [email protected]

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABxpZHs6sRCG_m1OXCUq3CPsQo19okwQzOi3dGXWJh-6dia0%3DQ%40mail.gmail.com.

Reply via email to