Skip to content

[Forwardport] Allow to configure min and max dates for date picker component #14683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rostyslav-hymon
Copy link
Contributor

Original Pull Request

#14552

Description

Currently it is not possible to pass over the min and max dates for the datepicker component. This issue is fixed in this PR.

e.g. after this the date field can be used like this:

       $fieldset->addField(
            'my_date',
            'date',
            [
                'name' => 'my_date',
                'label' => __('Date'),
                'title' => __('Date'),
                'format' => 'yyyy-mm-dd',
                'min_date' => (new DateTimeImmutable('today+1 day'))->format('Y-m-d'),
                'max_date' => (new DateTimeImmutable('today+1 week'))->format('Y-m-d'),
                'required' => true
            ]
        );

@magento-engcom-team
Copy link
Contributor

Hi @rostyslav-hymon. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants