wilsonfreitas / python-bizdays

Business days calculations and utilities
http://wilsonfreitas.github.io/python-bizdays/
MIT License
80 stars 34 forks source link

Wrong values #33

Closed rrremedio closed 2 years ago

rrremedio commented 2 years ago

bizdays version 1.0.11

'bizdays' is returning wrong values.

Reproducible example (September 2022 has 21 business days with Anbima calendar):

bizdays("2022-09-01", "2022-09-30", "Brazil/ANBIMA") 20

bizdays("2022-09-01", "2022-10-01", "Brazil/ANBIMA") 20

However, that's correct:

length(bizseq(dmy("01/09/2022"), dmy("01/10/2022"), "Brazil/ANBIMA")) 21

wilsonfreitas commented 2 years ago

No, it's not wrong, it's documented.

Please, read the docs https://cran.r-project.org/web/packages/bizdays/vignettes/Financial_and_non_financial.html

This is a usual misunderstanding. It happens everytime a nonworking day is used in from or to arguments.

is.bizday(c("2022-09-30", "2022-10-01"), "Brazil/ANBIMA")