andrejsstepanovs / business-days-calculator

Business Days Calculator
MIT License
24 stars 21 forks source link

A class to fill all the holidays from Brazil #7

Closed royopa closed 6 years ago

royopa commented 6 years ago

Hi

I created a class CalculatorBrazil that extends \BusinessDays\Calculator and fill all the official Brazil holidays extracted from Anbima.

What do you think about merge this class to this project? Or you prefer that I create a new repository dependent of \BusinessDays\Calculator?

andrejsstepanovs commented 6 years ago

Hi! I never intended to include data into this library. It is intended to be able to make calculations based on given data. Where that data is coming from depends completely on application. That is why even Saturday and Sunday as free week days needs to be set by application.

Also I don't see how you can hardcode every free day in your class. It will change year by year because not all free days are happening on the same date. Some religious holidays are happening for example second monday of a X month. And there will be more things like that, that you can not predict easily. I advise you to store this info in some data storage and build interface for users (employees or admin) to be able to change it year by year. Or just hardcode it in application. ;)

royopa commented 6 years ago

Ok @andrejsstepanovs thanks for the information! So I will close this issue. Regards!