Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Santiago Carrillo Barbosa - Android Calendar Picker
 * email: sancarbar@gmail.com
 *
 * https://github.com/sancarbar/Android-Calendar-Picker
 *
 * (C) 2013, Santiago Carrillo
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation;
 * version 3 of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 */

import java.text.DateFormatSymbols;

public class Main {
    private static final DateFormatSymbols dateFormatSymbols = new DateFormatSymbols();

    public static String getMonthNameFromLocale(int month) {
        if (month < 0 || month > 11)
            throw new IndexOutOfBoundsException("Invalid index, value must be between 0 and 11");

        return dateFormatSymbols.getMonths()[month].toUpperCase();
    }
}