File tree Expand file tree Collapse file tree 6 files changed +26
-3
lines changed
code/Magento/Rule/Model/Condition
design/adminhtml/Magento/backend/web/css
internal/Magento/Framework/Data Expand file tree Collapse file tree 6 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,9 @@ public function getValueElement()
630630 // date format intentionally hard-coded
631631 $ elementParams ['input_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
632632 $ elementParams ['date_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
633+ $ elementParams ['placeholder ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
634+ $ elementParams ['autocomplete ' ] = 'off ' ;
635+ $ elementParams ['readonly ' ] = 'true ' ;
633636 }
634637 return $ this ->getForm ()->addField (
635638 $ this ->getPrefix () . '__ ' . $ this ->getId () . '__value ' ,
Original file line number Diff line number Diff line change 38403840
38413841 .rule-param-edit .element {
38423842 display : inline ;
3843+ position : relative ;
3844+ }
3845+
3846+ .rule-param-edit .element input .input-date ,
3847+ .rule-param-edit .element input .input-date [readonly] {
3848+ background-color : @color-white ;
3849+ min-width : 140px ;
3850+ width : 140px !important ;
3851+ cursor : pointer ;
3852+ text-align : center ;
3853+ opacity : 1 ;
3854+ margin-right : 10px ;
3855+ padding-right : 40px ;
3856+
3857+ + .ui-datepicker-trigger {
3858+ position : absolute ;
3859+ width : 140px ;
3860+ text-align : right ;
3861+ left : 0 ;
3862+ }
38433863 }
38443864
38453865 .rule-param-edit .element .addafter {
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ public function getHtmlAttributes()
238238 'onchange ' ,
239239 'disabled ' ,
240240 'readonly ' ,
241+ 'autocomplete ' ,
241242 'tabindex ' ,
242243 'placeholder ' ,
243244 'data-form-part ' ,
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ public function getValueInstance()
147147 */
148148 public function getElementHtml ()
149149 {
150- $ this ->addClass ('admin__control-text input-text ' );
150+ $ this ->addClass ('admin__control-text input-text input-date ' );
151151 $ dateFormat = $ this ->getDateFormat () ?: $ this ->getFormat ();
152152 $ timeFormat = $ this ->getTimeFormat ();
153153 if (empty ($ dateFormat )) {
Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ public function testGetHtmlAttributes()
195195 'onchange ' ,
196196 'disabled ' ,
197197 'readonly ' ,
198+ 'autocomplete ' ,
198199 'tabindex ' ,
199200 'placeholder ' ,
200201 'data-form-part ' ,
Original file line number Diff line number Diff line change 378378 . text ( '' ) // Remove jQuery UI datepicker generated image
379379 . append ( '<span>' + pickerButtonText + '</span>' ) ;
380380
381- $ ( element ) . attr ( 'autocomplete' , 'off' ) ;
382-
383381 this . _setCurrentDate ( element ) ;
384382 } ,
385383
You can’t perform that action at this time.
0 commit comments