Skip to content

Remove datepicker if readonly is active #20

@stefanheimes

Description

@stefanheimes

We should change the getFieldDefinition. If the "readonly" is active we don't need the Datepicker. Because the datepicker is able to set a new Date.

    public function getFieldDefinition($arrOverrides = array())
    {
        $strDateType                 = $this->getDateTimeType();
        $readOnly                    = $this->getOverrideValue('readonly', $arrOverrides);
        $arrFieldDef                 = parent::getFieldDefinition($arrOverrides);
        $arrFieldDef['eval']['rgxp'] = $strDateType;
        if (!$readOnly) {
            $arrFieldDef['eval']['datepicker'] = ($strDateType !== 'time');
        }

        return $arrFieldDef;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions