Java Cookbook
Holiday
Problem:
You want to know what holidays are common for a locale.
Solution:
Icu4j contains a system to help the Java developer handle international holidays. The Holiday class is simple to use, and has failry complete data.
To get an Array of all Holidays for Mexico:
//Get a ULocale
ULocale locale = new ULocale("es_MX");
//Get an array of Holidays
Holiday[] holidays = Holiday.getHolidays(locale);
If you are testing any of these recipes in Eclipse and the characters are not displaying correctly in your console visit http://i18ncookbook.com/eclipse_settings.
This site is ad supported. I hope you find something among our sponsors worth clicking. ;)
i18n search
Custom Search