question

Upvotes
43 4 5 11

rd.dates_and_calendars.date_schedule does not return the correct non working dates

Hello.

I assume there is a bug in the method rd.dates_and_calendars.date_schedule .

When the end date is a public holidays, it returns the day after, if start_date == end_date.

Please, check the code below and advice.

Thanks


public-holidays-us.png


error-date-schedule.png

Expected behaviour: the list should be empty

If I change the start_date to set it to a working day, then the behaviour is correct.



pythonworkspace#technologypython apilseg-data-library
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
7.2k 22 3 6

Hi @yaokoffi.kouassi ,

Thank you for your question. The way the function works is such that if there is no working day in the time window (in between start_date & end_date), then the next working day is returned:

1728912206727.png


Otherwise, if there is any working day at all in the window, these are the only ones returned:


1728912350068.png


1728912206727.png (29.7 KiB)
1728912350068.png (8.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.