Code example for DateFormatSymbols

Methods: getMonths

0
            return currYear - 1;
        } 
    } 
 
    public static String getReportMonthString() {
        DateFormatSymbols dfs = new DateFormatSymbols(new Locale("ro"));
        String[] months = dfs.getMonths();
        if (Calendar.getInstance().get(Calendar.MONTH) > 0) {
            return months[Calendar.getInstance().get(Calendar.MONTH) - 1];
        } else { 
            return months[11];
        } 
    } 
 
    public static int getReportMonthInt() { 
        if (Calendar.getInstance().get(Calendar.MONTH) > 0) {
            return Calendar.getInstance().get(Calendar.MONTH);
        } else { 
            return 12; 
        } 
    }