svendiedrichsen / jollyday

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

Init HolidayManager by Locale behaves different, depending on Locale.getDefault() #76

Closed MarkFried closed 6 years ago

MarkFried commented 6 years ago

See following snippet:

    ManagerParameter parameters = ManagerParameters.create(Locale.GERMAN);
    HolidayManager mgr = HolidayManager.getInstance(parameters);

    Set<Holiday> holidays = mgr.getHolidays(2018);

The resulting set is correct as long as the default locale of the system is GERMAN, but wrong as soon as it is run with a different system/default locale.

The result should always be the german holidays regardless of the system's locale.

svendiedrichsen commented 6 years ago

I will look into this. Thanks.

svendiedrichsen commented 6 years ago

The method ManagerParameters.create(Locale.GERMAN) can't find a country from the provided Locale. It subsequently uses the system default locale. You could fix this by using Locale.GERMANY or the class HolidayCalendars.GERMANY. I will make the code fall back to the language.