Package org.auraframework.util.date

Examples of org.auraframework.util.date.DateService


    @Override
    public Date convert(String value) {
        if (value == null || value.isEmpty()) {
            return null;
        }
        DateService dateService = DateServiceImpl.get();
        return dateService.getGenericISO8601Converter().parse(value);
    }
View Full Code Here


    @Override
    public String convert(DateOnly value) {
        if (value == null) {
            return null;
        }
        DateService dateService = DateServiceImpl.get();
        return dateService.getDateISO8601Converter().format(value);
    }
View Full Code Here

        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 "";
View Full Code Here

        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 "";
View Full Code Here

import org.auraframework.util.type.converter.DateToStringConverter;

public class LocalizedDateToStringConverter extends DateToStringConverter implements LocalizedConverter<Date, String> {
    @Override
    public String convert(Date value, AuraLocale locale) {
        DateService dateService = DateServiceImpl.get();
        return dateService.getDateTimeISO8601Converter().format(value, locale.getTimeZone());
    }
View Full Code Here

public class LocalizedDateOnlyToStringConverter extends DateOnlyToStringConverter implements
        LocalizedConverter<DateOnly, String> {

    @Override
    public String convert(DateOnly value, AuraLocale locale) {
        DateService dateService = DateServiceImpl.get();
        return dateService.getDateTimeISO8601Converter().format(value, locale.getTimeZone());
    }
View Full Code Here

public class LocalizedStringToDateConverter extends StringToDateConverter implements LocalizedConverter<String, Date> {

    @Override
    public Date convert(String value, AuraLocale locale) {
        DateService dateService = DateServiceImpl.get();
        return dateService.getGenericISO8601Converter().parse(value, locale.getTimeZone());
    }
View Full Code Here

public class LocalizedStringToDateOnlyConverter extends StringToDateOnlyConverter implements
        LocalizedConverter<String, DateOnly> {

    @Override
    public DateOnly convert(String value, AuraLocale locale) {
        DateService dateService = DateServiceImpl.get();
        Date d = dateService.getDateISO8601Converter().parse(value, locale.getTimeZone());
        return new DateOnly(d.getTime());
    }
View Full Code Here

    public static class DateSerializer extends NoneSerializer<Date> {

        @Override
        public void serialize(Json json, Date value) throws IOException {
            DateService dateService = DateServiceImpl.get();
            String ret = dateService.getDateTimeISO8601Converter().format(value);
            json.writeString(ret);
        }
View Full Code Here

    public static class DateOnlySerializer extends NoneSerializer<Date> {

        @Override
        public void serialize(Json json, Date value) throws IOException {
            DateService dateService = DateServiceImpl.get();
            String ret = dateService.getDateISO8601Converter().format(value);
            json.writeString(ret);
        }
View Full Code Here

TOP

Related Classes of org.auraframework.util.date.DateService

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.