cancel
Showing results for 
Search instead for 
Did you mean: 

adjusting datepicker widget in order form

adjusting datepicker widget in order form

Hi there ,

 

I am using oye's deliovery date module as a learning method :-) (http://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/)

 

at the order form where user gives adres and so on , there's now a nice datepicker element, it works fine.

 

Offcourse i want to look into that and try to make it only weekends and maybe range too, i googled a lot and found out about noweekend function and thought"well thats easy "  but WRONG !, i cant find the place where to add the noweekend option.

 

it should be something like 

 

$(function() {
 $( "#datepicker" ).datepicker({
 beforeShowDay: $.datepicker.noWeekends
 });
 });

but the closest i can find in the oyes module is

 

        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_date'] = [
            'component' => 'Magento_Ui/js/form/element/abstract',
            'config' => [
                'customScope' => 'shippingAddress',
                'template' => 'ui/form/field',
                'elementTmpl' => 'ui/form/element/date',
                'options' => [],
                'id' => 'delivery-date'

in which i tried just filling in 'options' ['noweekend'] but did not bring solution 

 

the code of oye's order form is below 


<?php namespace Oye\Deliverydate\Model\Checkout; class LayoutProcessorPlugin { /** * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject * @param array $jsLayout * @return array */ public function afterProcess( \Magento\Checkout\Block\Checkout\LayoutProcessor $subject, array $jsLayout ) { $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] ['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_date'] = [ 'component' => 'Magento_Ui/js/form/element/abstract', 'config' => [ 'customScope' => 'shippingAddress', 'template' => 'ui/form/field', 'elementTmpl' => 'ui/form/element/date', 'options' => [], 'id' => 'delivery-date' ], 'dataScope' => 'shippingAddress.delivery_date', 'label' => 'Delivery Date', 'provider' => 'checkoutProvider', 'visible' => true, 'validation' => [], 'sortOrder' => 200, 'id' => 'delivery-date' ]; return $jsLayout; } }

 any guidance or help?