Search in sources :

Example 1 with EthiopicCalendar

use of com.ibm.icu.util.EthiopicCalendar in project mycore by MyCoRe-Org.

the class MCRCalendar method getCalendarFromEthiopicDate.

/**
 * This method convert a EthiopicCalendar date to a EthiopicCalendar value.
 * The syntax for the ethiopic input is: <br>
 * <ul>
 * <li> [[[t]t.][m]m.][yyy]y [E.E.]</li>
 * <li> y[yyy][-m[m][-t[t]]] [E.E.]</li>
 * </ul>
 *
 * @param date_string
 *            the date as string.
 * @param last
 *            the value is true if the date should be filled with the
 *            highest value of month or day like 13 or 30 else it fill the
 *            date with the lowest value 1 for month and day.
 *
 * @return the EthiopicCalendar date value or null if an error was occurred.
 * @exception MCRException if parsing has an error
 */
protected static EthiopicCalendar getCalendarFromEthiopicDate(String date_string, boolean last) {
    try {
        int[] fields = checkDateStringForCopticCalendar(date_string, last);
        EthiopicCalendar calendar = new EthiopicCalendar();
        calendar.set(fields[0], fields[1], fields[2]);
        return calendar;
    } catch (Exception e) {
        throw new MCRException("The ancient ethiopic calendar date is false.", e);
    }
}
Also used : EthiopicCalendar(com.ibm.icu.util.EthiopicCalendar)

Aggregations

EthiopicCalendar (com.ibm.icu.util.EthiopicCalendar)1