Example usage for java.text DateFormatSymbols getInstance

List of usage examples for java.text DateFormatSymbols getInstance

Introduction

In this page you can find the example usage for java.text DateFormatSymbols getInstance.

Prototype

public static final DateFormatSymbols getInstance(Locale locale) 

Source Link

Document

Gets the DateFormatSymbols instance for the specified locale.

Usage

From source file:com.erudika.para.utils.Utils.java

/**
 * Returns an array of the months in the Gregorian calendar.
 * @param locale the locale used for the months' names
 * @return an array of the 12 months//from w  w  w.  j a  v a  2s. c om
 */
public static String[] getMonths(Locale locale) {
    if (locale == null) {
        locale = Locale.US;
    }
    DateFormatSymbols dfs = DateFormatSymbols.getInstance(locale);
    return dfs.getMonths();
}