Examples of TGregorianCalendar


Examples of org.teavm.classlib.java.util.TGregorianCalendar

        applyPattern(pattern);
    }

    @Override
    public StringBuffer format(TDate date, StringBuffer buffer, TFieldPosition field) {
        TCalendar calendar = new TGregorianCalendar(locale);
        calendar.setTime(date);
        for (TDateFormatElement element : elements) {
            element.format(calendar, buffer);
        }
        return buffer;
    }
View Full Code Here

Examples of org.teavm.classlib.java.util.TGregorianCalendar

        elements = parser.getElements().toArray(new TDateFormatElement[0]);
    }

    @Override
    public TDate parse(String string, TParsePosition position) {
        TCalendar calendar = new TGregorianCalendar(locale);
        calendar.clear();
        for (TDateFormatElement element : elements) {
            if (position.getIndex() > string.length()) {
                position.setErrorIndex(position.getErrorIndex());
                return null;
            }
            element.parse(string, calendar, position);
            if (position.getErrorIndex() >= 0) {
                return null;
            }
        }
        return calendar.getTime();
    }
View Full Code Here

Examples of org.teavm.classlib.java.util.TGregorianCalendar

            if (c >= '0' && c <= '9') {
                num = num * 10 + (c - '0');
                ++pos;
            }
            position.setIndex(pos);
            TCalendar calendar = new TGregorianCalendar();
            int currentYear = calendar.get(TCalendar.YEAR);
            int currentShortYear = currentYear % 100;
            int century = currentYear / 100;
            if (currentShortYear > 80) {
                if (num < currentShortYear - 80) {
                    century++;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.