Interface DateField<F extends DateField<F>>
- All Superinterfaces:
Comparable<F>
,Component<F>
,Copyable<F>
,Field<F>
,FormComponent<F>
,Serializable
- All Known Implementing Classes:
DefaultDateField
Represents the metadata for a date picker field.
- Author:
- Dima Myroniuk (dmyroniuk)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
static enum
-
Method Summary
Modifier and TypeMethodDescriptiondefault F
dateFormat
(String format) Adds theDateField.Attributes.DATE_FORMAT
attribute.default F
defaultEndOf
(DateField.DateStartUnit endUnit) Use the current date default ending at the particular unit.default F
Represents a default value for a date set to the exact moment it is generated on the frontenddefault F
defaultStartOf
(DateField.DateStartUnit startUnit) Use the current date default starting at the particular unit.Finds theDateColumn.Attributes.DATE_FORMAT
attribute.default String
Gets theDateField.Attributes.DATE_FORMAT
attribute.default boolean
Checks whether theDateField.Attributes.DATE_FORMAT
attribute has been set.default F
Removes theDateField.Attributes.DATE_FORMAT
attribute.default F
validateIsAfter
(String messageKey, Object... arg) Creates a validation schema to verify that a date in this field is after a date in another field.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Component
addAction, addAction, addComponent, addEndpoint, addEndpoint, apply, attribute, augmentationKey, classifier, clearConditionals, clearEndpoints, conditional, conditionals, description, description, findAction, findAction, findActions, findAttribute, findAttribute, findComponent, findComponent, findComponents, findEndpoint, findEndpoint, findEndpoint, findEndpoints, get, get, getAction, getAction, getActions, getActionsList, getAttribute, getAttribute, getAttributes, getAugmentationKey, getClassifier, getComponent, getComponent, getComponents, getComponentsList, getConditionals, getDescription, getEndpoint, getEndpoint, getEndpoints, getEndpointsList, getId, getLabel, getOrder, getScope, getType, hasAction, hasAttribute, hasComponent, hasEndpoint, id, isAugmentable, isTranslatable, label, label, notTranslatable, order, removeAction, removeAttribute, removeComponent, removeEndpoint, scope, self, setActions, setAttributes, setAugmentationKey, setClassifier, setComponents, setConditionals, setDescription, setEndpoints, setId, setLabel, setOrder, setScope, setTranslatable, setType, translatable, translatable, type
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Field
clearReadOnlyConditionals, decorated, decorated, defaultValue, getDefaultValue, getName, getPlaceholder, getReadOnlyConditionals, getRequiredMessage, getValidationSchema, isReadOnly, isRequired, isShowInQueryBuilder, isTargetCollection, name, notReadOnly, notRequired, placeholder, placeholder, readOnly, readOnly, readOnlyConditional, readOnlyConditionals, required, required, required, required, requiredMessage, requiredMessage, setDefaultValue, setName, setPlaceholder, setReadOnly, setReadOnlyConditionals, setRequired, setRequiredMessage, setShowInQueryBuilder, setValidationSchema, targetIsCollection, targetIsNotCollection, validationMethod, validationSchema, validationSchema
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.FormComponent
getHelpText, getHint, getTooltip, helpText, helpText, helpText, hidden, hidden, hint, hint, isHidden, notHidden, setHelpText, setHidden, setHint, setTooltip, tooltip, tooltip
-
Method Details
-
defaultNow
Represents a default value for a date set to the exact moment it is generated on the frontend- Returns:
- this field for further customization
-
defaultStartOf
Use the current date default starting at the particular unit.defaultStartOf(DateStartUnit.YEAR)
= 2018-01-01 00:00:00defaultStartOf(DateStartUnit.HOUR)
= 2018-07-12 09:00:00
- Parameters:
startUnit
- the unit the default date should start at, never null- Returns:
- this field for further customization
-
defaultEndOf
Use the current date default ending at the particular unit. Examples of how the frontend will intepret certain values:defaultEndOf(DateStartUnit.YEAR)
= 2018-12-31 23:59:59defaultEndOf(DateStartUnit.HOUR)
= 2018-07-12 09:59:00
- Parameters:
endUnit
- the unit the default date should end, never null- Returns:
- this field for further customization
-
validateIsAfter
Creates a validation schema to verify that a date in this field is after a date in another field.- Parameters:
messageKey
- the message key of the validation errorarg
- the arguments for the validation method- Returns:
- this field for further customization
-
dateFormat
Adds theDateField.Attributes.DATE_FORMAT
attribute.- Parameters:
format
- The format to set. SeeDateFormatTypes
- Returns:
this
-
getDateFormat
Gets theDateField.Attributes.DATE_FORMAT
attribute.- Returns:
- the value of the attribute
-
findDateFormat
Finds theDateColumn.Attributes.DATE_FORMAT
attribute.- Returns:
- the value of the attribute or
Optional.empty()
if not present.
-
removeDateFormat
Removes theDateField.Attributes.DATE_FORMAT
attribute.- Returns:
this
-
hasDateFormat
default boolean hasDateFormat()Checks whether theDateField.Attributes.DATE_FORMAT
attribute has been set.- Returns:
- Whether the attribute is set.
-