public class DateTimeFormatHelper extends AbstractTimeFormatHelper<Object,Integer>
DateTimeFormatResolver
. The main advantage
lies in the ability to specify custom pattern per tag:
{{formatTime now pattern="DD-MM-yyyy HH:mm"}}
{{formatTime now pattern="HH:mm"}}
...
VALUE_TAG_TYPES
HELPER_TAG_TYPES
configuration
Constructor and Description |
---|
DateTimeFormatHelper() |
Modifier and Type | Method and Description |
---|---|
protected String |
defaultFormat(Object value,
Locale locale,
TimeZone timeZone) |
protected String |
format(Object value,
Integer style,
Locale locale,
TimeZone timeZone) |
protected String |
format(Object value,
String pattern,
Locale locale,
TimeZone timeZone) |
protected Object |
getFormattableObject(Object value,
Locale locale,
TimeZone timeZone,
MustacheTagInfo tagInfo) |
protected Integer |
parseStyle(String style,
MustacheTagInfo tagInfo) |
execute, getSupportedHashKeys, getTimeZone, unknownStyle, valueNotAFormattableObject
getCurrentLocale, getCurrentLocale, getLocale, init
allowedTagTypes
getRequiredHashKeys, numberOfRequiredHashEntries, numberOfRequiredParameters, validate
append, convertAndAppend, convertValue, isSection, isUnescapeVariable, isVariable
checkNotInitialized, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfigurationKeys, init
protected String defaultFormat(Object value, Locale locale, TimeZone timeZone)
defaultFormat
in class AbstractTimeFormatHelper<Object,Integer>
protected String format(Object value, Integer style, Locale locale, TimeZone timeZone)
format
in class AbstractTimeFormatHelper<Object,Integer>
protected String format(Object value, String pattern, Locale locale, TimeZone timeZone)
format
in class AbstractTimeFormatHelper<Object,Integer>
protected Object getFormattableObject(Object value, Locale locale, TimeZone timeZone, MustacheTagInfo tagInfo)
getFormattableObject
in class AbstractTimeFormatHelper<Object,Integer>
protected Integer parseStyle(String style, MustacheTagInfo tagInfo)
parseStyle
in class AbstractTimeFormatHelper<Object,Integer>
Copyright © 2017. All rights reserved.