- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020
08:47 AM
05-12-2020
08:47 AM
Date Format by UI component shows wrong date of birth
I have created one new customer attribute of date-of-birth for that I have added it in checkout page by extending LayoutProcessor's public function
afterProcess(\Magento\Checkout\Block\Checkout\LayoutProcessor $subject, array $jsLayout){ $customField1 = [ 'component' => 'Magento_Ui/js/form/element/abstract', 'config' => [ // customScope is used to group elements within a single form (e.g. they can be validated separately) 'customScope' => 'shippingAddress.custom_attributes', 'customEntry' => null, 'template' => 'ui/form/field', 'elementTmpl' => 'ui/form/element/date', 'options' => [ 'changeYear'=> true, 'changeMonth'=> true, 'yearRange' => '-120y:c+nn', 'maxDate' => '-1d' ], ], 'dataScope' => 'shippingAddress.custom_attributes.dob', 'provider' => 'checkoutProvider', 'validation' => [ 'required-entry' => false ], 'options' => [], 'filterBy' => null, 'customEntry' => null, 'visible' => true, 'disabled' => $disabled, 'value' => "11/6/1997" // value field is used to set a default value of the attribute ]; }
But on frontend I can see like this :
PS : I am using Magento Enterprise Edition.
Problem Solved ? Click on 'Kudos' & Accept as Solution !

Labels: