Skip to content

[Backport] Allow configuring min and max dates for date picker component #15318

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

Merged

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented May 18, 2018

Original PR: #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 magento-engcom-team added this to the May 2018 milestone May 21, 2018
@magento-engcom-team magento-engcom-team added Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept labels May 21, 2018
@magento-engcom-team magento-engcom-team merged commit 02fc8c4 into magento:2.1-develop May 23, 2018
@magento-engcom-team
Copy link
Contributor

Hi @rogyar. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.1.15 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants