Package org.auraframework.service

Examples of org.auraframework.service.LocalizationService


        }
        // should this be made accessible in the component?
        Locale loc = null;

        String format = (String) component.getAttributes().getValue("format");
        LocalizationService lclService = Aura.getLocalizationService();

        if (format == null) {
            String dateStyle = (String) component.getAttributes().getValue("dateStyle");
            String timeStyle = (String) component.getAttributes().getValue("timeStyle");
            DateService dateService = DateServiceImpl.get();
            int intDateStyle = dateService.getStyle(dateStyle);
            int intTimeStyle = dateService.getStyle(timeStyle);
            return lclService.formatDateTime(cal.getTime(), loc, tz, intDateStyle, intTimeStyle);
        } else {
            // no pattern, no result
            if (AuraTextUtil.isEmptyOrWhitespace(format)) {
                return "";
            } else {
                try {
                    return lclService.formatDateTime(cal.getTime(), loc, tz, format);
                } catch (IllegalArgumentException e) {
                    return "You must provide a valid format: " + e.getMessage();
                }
            }
View Full Code Here


        }
        // should this be made accessible in the component?
        Locale loc = null;

        String format = (String) component.getAttributes().getValue("format");
        LocalizationService lclService = Aura.getLocalizationService();

        if (format == null) {
            String dateStyle = (String) component.getAttributes().getValue("dateStyle");
            DateService dateService = DateServiceImpl.get();
            int intDateStyle = dateService.getStyle(dateStyle);
            return lclService.formatDate(date, loc, tz, intDateStyle);
        } else {
            // no pattern, no result
            if (AuraTextUtil.isEmptyOrWhitespace(format)) {
                return "";
            } else {
                try {
                    return lclService.formatDateTime(date, loc, tz, format);
                } catch (IllegalArgumentException e) {
                    return "You must provide a valid format: " + e.getMessage();
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.auraframework.service.LocalizationService

Copyright © 2018 www.massapicom. 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.