File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Cms/view/adminhtml/ui_component
Ui/view/base/web/js/lib/validation Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 285
285
<settings >
286
286
<validation >
287
287
<rule name =" validate-date" xsi : type =" boolean" >true</rule >
288
+ <rule name =" validate-date-range" xsi : type =" string" >custom_theme_from</rule >
288
289
</validation >
289
290
<dataType >text</dataType >
290
291
<label translate =" true" >To</label >
Original file line number Diff line number Diff line change @@ -803,6 +803,14 @@ define([
803
803
} ,
804
804
$ . mage . __ ( 'Please enter a valid date.' )
805
805
] ,
806
+ 'validate-date-range' : [
807
+ function ( value , params ) {
808
+ var fromDate = $ ( 'input[name*="' + params + '"]' ) . val ( ) ;
809
+
810
+ return moment . utc ( value ) . unix ( ) >= moment . utc ( fromDate ) . unix ( ) || isNaN ( moment . utc ( value ) . unix ( ) ) ;
811
+ } ,
812
+ $ . mage . __ ( 'Make sure the To Date is later than or the same as the From Date.' )
813
+ ] ,
806
814
'validate-identifier' : [
807
815
function ( value ) {
808
816
return utils . isEmptyNoTrim ( value ) || / ^ [ a - z 0 - 9 ] [ a - z 0 - 9 _ \/ - ] + ( \. [ a - z 0 - 9 _ - ] + ) ? $ / . test ( value ) ;
You can’t perform that action at this time.
0 commit comments