DateDataField

This field class handles field of type Date.

class Person extends Model {
    static get fields() {
        return [
            'name',
            { name : 'birthday', type : 'date', format : 'YYYY-MM-DD' },
            { name : 'age', readOnly : true }
        ];
    }
}

When a field is declared as a 'date', non-null values are promoted to Date type. This is frequently needed due to how date types are serialized to JSON strings.

Date fields can have a special defaultValue of 'now' which will convert to the current date/time.

Configs

19
format: String= DateHelper.defaultFormat

The format of the date field.

See DateHelper for details.

alwaysWriteDataField
calculateDataField
columnDataField
compareDataField
dataSourceDataField
defaultValueDataField
descriptionDataField
internalDataField
labelDataField
nameDataField
nullableDataField
nullTextDataField
nullValueDataField
persistDataField
readOnlyDataField

Properties

7

Class hierarchy

isDateDataField: Boolean= truereadonly
Identifies an object as an instance of DateDataField class, or subclass thereof.
isDateDataField: Boolean= truereadonlystatic
Identifies an object as an instance of DateDataField class, or subclass thereof.
isDataFieldDataField

Lifecycle

configBase

Functions

19

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase

Other

convertDataField
isEqualDataField
printDataField
printValueDataField
serializeDataField