Examples of DateFormatCollection


Examples of org.teavm.classlib.impl.unicode.DateFormatCollection

    public static TDateFormat getDateInstance(int style, TLocale locale) {
        return new TSimpleDateFormat(getDateFormatString(style, locale), locale);
    }

    private static String getDateFormatString(int style, TLocale locale) {
        DateFormatCollection formats = CLDRHelper.resolveDateFormats(locale.getLanguage(), locale.getCountry());
        switch (style) {
            case SHORT:
                return formats.getShortFormat();
            case MEDIUM:
                return formats.getMediumFormat();
            case LONG:
                return formats.getLongFormat();
            case FULL:
                return formats.getFullFormat();
            default:
                throw new IllegalArgumentException("Unknown style: " + style);
        }
    }
View Full Code Here

Examples of org.teavm.classlib.impl.unicode.DateFormatCollection

                .replace("{1}", getDateFormatString(timeStyle, locale));
        return new TSimpleDateFormat(pattern, locale);
    }

    public static String getDateTimeFormatString(int style, TLocale locale) {
        DateFormatCollection formats = CLDRHelper.resolveDateTimeFormats(locale.getLanguage(), locale.getCountry());
        switch (style) {
            case SHORT:
                return formats.getShortFormat();
            case MEDIUM:
                return formats.getMediumFormat();
            case LONG:
                return formats.getLongFormat();
            case FULL:
                return formats.getFullFormat();
            default:
                throw new IllegalArgumentException("Unknown style: " + style);
        }
    }
View Full Code Here

Examples of org.teavm.classlib.impl.unicode.DateFormatCollection

    public static TDateFormat getTimeInstance(int style, TLocale locale) {
        return new TSimpleDateFormat(getTimeFormatString(style, locale), locale);
    }

    private static String getTimeFormatString(int style, TLocale locale) {
        DateFormatCollection formats = CLDRHelper.resolveTimeFormats(locale.getLanguage(), locale.getCountry());
        switch (style) {
            case SHORT:
                return formats.getShortFormat();
            case MEDIUM:
                return formats.getMediumFormat();
            case LONG:
                return formats.getLongFormat();
            case FULL:
                return formats.getFullFormat();
            default:
                throw new IllegalArgumentException("Unknown style: " + style);
        }
    }
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.