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 @@ -630,6 +630,9 @@ public function getValueElement()
630
630
// date format intentionally hard-coded
631
631
$ elementParams ['input_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
632
632
$ 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 ' ;
633
636
}
634
637
return $ this ->getForm ()->addField (
635
638
$ 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 @@ -147,7 +147,7 @@ public function getValueInstance()
147
147
*/
148
148
public function getElementHtml ()
149
149
{
150
- $ this ->addClass ('admin__control-text input-text ' );
150
+ $ this ->addClass ('admin__control-text input-text input-date ' );
151
151
$ dateFormat = $ this ->getDateFormat () ?: $ this ->getFormat ();
152
152
$ timeFormat = $ this ->getTimeFormat ();
153
153
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 378
378
. text ( '' ) // Remove jQuery UI datepicker generated image
379
379
. append ( '<span>' + pickerButtonText + '</span>' ) ;
380
380
381
- $ ( element ) . attr ( 'autocomplete' , 'off' ) ;
382
-
383
381
this . _setCurrentDate ( element ) ;
384
382
} ,
385
383
You can’t perform that action at this time.
0 commit comments