Android Month String Get getMonthNames(Locale l, int len)

Here you can find the source of getMonthNames(Locale l, int len)

Description

get Month Names

Declaration

public static String[] getMonthNames(Locale l, int len) 

Method Source Code

//package com.java2s;
import static java.util.Calendar.*;
import java.text.DateFormatSymbols;

import java.util.Locale;

public class Main {
    public static String[] getMonthNames(Locale l, int len) {

        String[] s;//from ww w  .j a v  a  2s . com
        if (len == SHORT)
            s = new DateFormatSymbols(l).getShortMonths();
        else
            s = new DateFormatSymbols(l).getMonths();

        return s;
    }

    public static String[] getMonthNames() {
        return getMonthNames(Locale.getDefault(), LONG);
    }

    public static String[] getShortMonths() {
        return getMonthNames(Locale.getDefault(), SHORT);
    }
}

Related

  1. getMonthString(int month, int abbrev)
  2. getMonthStringByIndex(int index)
  3. getReadableMonth(int month)
  4. getCurrentMonth()
  5. getMonthNames()
  6. getShortMonths()
  7. getShortMonthString(int month)
  8. getLongMonthString(int month)
  9. GetMonthName(int month)