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([
836836 ] ,
837837 'less-than-equals-to' : [
838838 function ( value , params ) {
839+ if ( ! $ . isNumeric ( params ) ) {
840+ params = $ ( params ) . val ( ) ;
841+ }
842+
839843 if ( $ . isNumeric ( params ) && $ . isNumeric ( value ) ) {
844+ this . lteToVal = params ;
845+
840846 return parseFloat ( value ) <= parseFloat ( params ) ;
841847 }
842848
843849 return true ;
844850 } ,
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+ }
846854 ] ,
847855 'greater-than-equals-to' : [
848856 function ( value , params ) {
857+ if ( ! $ . isNumeric ( params ) ) {
858+ params = $ ( params ) . val ( ) ;
859+ }
860+
849861 if ( $ . isNumeric ( params ) && $ . isNumeric ( value ) ) {
862+ this . gteToVal = params ;
863+
850864 return parseFloat ( value ) >= parseFloat ( params ) ;
851865 }
852866
853867 return true ;
854868 } ,
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+ }
856872 ] ,
857873 'validate-emails' : [
858874 function ( value ) {
You can’t perform that action at this time.
0 commit comments