Skip to content

Conversation

vasilii-b
Copy link

@vasilii-b vasilii-b commented Jun 20, 2018

Description

The full description of the issue and steps to reproduce are provided in #7379.
The same issue is reproduced on Magento 2.1, Magento 2.2 and Magento 2.3-develop

Fixed Issues

  1. Calendar widget (jQuery UI DatePicker) with numberOfMonths = 2 or more #7379: Calendar widget (jQuery UI DatePicker) with numberOfMonths = 2 or more

Manual testing scenarios

The easiest way to see the issue in action is to add a new field in the Magento_Contact form that is gonna use a calendar.

Field to add:

<div class="field availability">
  <label class="label" for="availability"><span><?= $block->escapeHtml(__('Availability')) ?></span></label>
   <div class="control">
       <input name="availability" id="availability" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>"
            value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('availability')) ?>" class="input-text" type="text" />
  </div>
</div>

Initialize the calendar:

<script>
    require(['jquery', 'mage/calendar'], function($, calendar) {
       $('#availability').calendar({
           numberOfMonths: [1, 2]
       });
    });
</script>

You should see only 2 months displayed, like this:
image

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Original PR

#16279

…onths` to show more than 1 month

(cherry picked from commit 54e1a71)
@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 Area: Lib/Frontend labels Jun 20, 2018
@vasilii-b vasilii-b self-assigned this Jun 20, 2018
@vasilii-b vasilii-b changed the title MAGETWO-61209: Backport - Fixed issue with mage/calendar when setting `numberOfM… MAGETWO-61209: Backport - Fixed issue #7379 with mage/calendar when setting `numberOfM… Jun 20, 2018
@magento-engcom-team magento-engcom-team added this to the Release: 2.1.15 milestone Jun 22, 2018
@magento-engcom-team magento-engcom-team merged commit ce38bc8 into magento:2.1-develop Jun 29, 2018
magento-engcom-team pushed a commit that referenced this pull request Jun 29, 2018
@magento-engcom-team
Copy link
Contributor

Hi @vasilii-b. Thank you for your contribution.
The changes from your Pull Request should be available with the upcoming 2.1.15 release.
Please check the release notes for final confirmation.

@vasilii-b vasilii-b deleted the MAGETWO-61209-calendar-widget-number-of-months_mage21 branch June 29, 2018 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Lib/Frontend 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