File tree 6 files changed +26
-3
lines changed
code/Magento/Rule/Model/Condition
design/adminhtml/Magento/backend/web/css
internal/Magento/Framework/Data 6 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,9 @@ public function getValueElement()
615
615
// date format intentionally hard-coded
616
616
$ elementParams ['input_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
617
617
$ elementParams ['date_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
618
+ $ elementParams ['placeholder ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
619
+ $ elementParams ['autocomplete ' ] = 'off ' ;
620
+ $ elementParams ['readonly ' ] = 'true ' ;
618
621
}
619
622
return $ this ->getForm ()->addField (
620
623
$ this ->getPrefix () . '__ ' . $ this ->getId () . '__value ' ,
Original file line number Diff line number Diff line change 3840
3840
3841
3841
.rule-param-edit .element {
3842
3842
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
+ }
3843
3863
}
3844
3864
3845
3865
.rule-param-edit .element .addafter {
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ public function getHtmlAttributes()
238
238
'onchange ' ,
239
239
'disabled ' ,
240
240
'readonly ' ,
241
+ 'autocomplete ' ,
241
242
'tabindex ' ,
242
243
'placeholder ' ,
243
244
'data-form-part ' ,
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ public function getValueInstance()
146
146
*/
147
147
public function getElementHtml ()
148
148
{
149
- $ this ->addClass ('admin__control-text input-text ' );
149
+ $ this ->addClass ('admin__control-text input-text input-date ' );
150
150
$ dateFormat = $ this ->getDateFormat () ?: $ this ->getFormat ();
151
151
$ timeFormat = $ this ->getTimeFormat ();
152
152
if (empty ($ dateFormat )) {
Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ public function testGetHtmlAttributes()
195
195
'onchange ' ,
196
196
'disabled ' ,
197
197
'readonly ' ,
198
+ 'autocomplete ' ,
198
199
'tabindex ' ,
199
200
'placeholder ' ,
200
201
'data-form-part ' ,
Original file line number Diff line number Diff line change 380
380
. text ( '' ) // Remove jQuery UI datepicker generated image
381
381
. append ( '<span>' + pickerButtonText + '</span>' ) ;
382
382
383
- $ ( element ) . attr ( 'autocomplete' , 'off' ) ;
384
-
385
383
this . _setCurrentDate ( element ) ;
386
384
} ,
387
385
You can’t perform that action at this time.
0 commit comments