svendiedrichsen / jollyday

Jollyday - A holiday API
Other
190 stars 114 forks source link

Multiple HolidayManager objects using different Holiday sources #102

Closed Netskeh closed 5 years ago

Netskeh commented 5 years ago

Hey,

I was wondering if it is possible to have 2 (or more) different HolidayManagers objects. So far I only found the HolidayManager#getInstance(...), which heavily suggests it works as a Singleton. My use-case involves taking care of Holidays of different countries (or states depending of the specific country) Did I miss anything or is jollyday not ready for that just yet?

If multiple objects are not possible, how could I safely change the configuration to do my operations in a sequential fashion?

thackel commented 5 years ago

Why do you think you can not create multiple HolidayManagers with HolidayManager.getInstance(managerParameter)?

I am doing this with this method.

Netskeh commented 5 years ago

this is awkward. You are absolutely right. The error must be hidden in my facade somewhere... Thanks your comment gave me the incentive of testing it on a fresh project.

Netskeh commented 5 years ago

and a very stupid one at that. Let's never talk about it again.