File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
app/code/Magento/Ui/view/base/web/js/lib/validation Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -836,23 +836,39 @@ define([
836
836
] ,
837
837
'less-than-equals-to' : [
838
838
function ( value , params ) {
839
+ if ( ! $ . isNumeric ( params ) ) {
840
+ params = $ ( params ) . val ( ) ;
841
+ }
842
+
839
843
if ( $ . isNumeric ( params ) && $ . isNumeric ( value ) ) {
844
+ this . lteToVal = params ;
845
+
840
846
return parseFloat ( value ) <= parseFloat ( params ) ;
841
847
}
842
848
843
849
return true ;
844
850
} ,
845
- $ . mage . __ ( 'Please enter a value less than or equal to {0}.' )
851
+ function ( ) {
852
+ return $ . mage . __ ( 'Please enter a value less than or equal to %s.' ) . replace ( '%s' , this . lteToVal ) ;
853
+ }
846
854
] ,
847
855
'greater-than-equals-to' : [
848
856
function ( value , params ) {
857
+ if ( ! $ . isNumeric ( params ) ) {
858
+ params = $ ( params ) . val ( ) ;
859
+ }
860
+
849
861
if ( $ . isNumeric ( params ) && $ . isNumeric ( value ) ) {
862
+ this . gteToVal = params ;
863
+
850
864
return parseFloat ( value ) >= parseFloat ( params ) ;
851
865
}
852
866
853
867
return true ;
854
868
} ,
855
- $ . mage . __ ( 'Please enter a value greater than or equal to {0}.' )
869
+ function ( ) {
870
+ return $ . mage . __ ( 'Please enter a value greater than or equal to %s.' ) . replace ( '%s' , this . gteToVal ) ;
871
+ }
856
872
] ,
857
873
'validate-emails' : [
858
874
function ( value ) {
You can’t perform that action at this time.
0 commit comments