001
014
015 package com.liferay.portlet.dynamicdatamapping.storage;
016
017 import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
018 import com.liferay.portal.kernel.util.StringPool;
019 import com.liferay.portal.kernel.util.Validator;
020
021 import java.io.Serializable;
022
023 import java.text.Format;
024
025 import java.util.Locale;
026
027
031 public class DateFieldRenderer extends BaseFieldRenderer {
032
033 @Override
034 protected String doRender(Field field, Locale locale) {
035 Serializable value = field.getValue();
036
037 if (Validator.isNull(value)) {
038 return StringPool.BLANK;
039 }
040
041 Format format = FastDateFormatFactoryUtil.getDate(locale);
042
043 return format.format(value);
044 }
045
046 }