mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
Update ShippingStepComponenet.vue. fixing datepicker validation month logic
This commit is contained in:
@@ -140,10 +140,10 @@
|
||||
</div>
|
||||
</modal-component>
|
||||
<confirm-modal-component v-if="arrangementExist"
|
||||
title="Arrived To Port"
|
||||
:message="'Are you sure this order has arrived to port?'"
|
||||
type="shippingComplete"
|
||||
v-on:confirm="completeShipping()"></confirm-modal-component>
|
||||
title="Arrived To Port"
|
||||
:message="'Are you sure this order has arrived to port?'"
|
||||
type="shippingComplete"
|
||||
v-on:confirm="completeShipping()"></confirm-modal-component>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
@@ -179,6 +179,7 @@
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.validateMethod();
|
||||
this.dataValidation();
|
||||
},
|
||||
created(){
|
||||
@@ -189,6 +190,11 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateMethod() {
|
||||
$.validator.addMethod("minDate", function(value, element, params) {
|
||||
return (moment(value, "DD-MM-YYYY") > moment(params, "DD-MM-YYYY"))
|
||||
});
|
||||
},
|
||||
dataValidation() {
|
||||
$(this.$el).find('.shippingForm').validate({
|
||||
rules: {
|
||||
@@ -199,7 +205,7 @@
|
||||
},
|
||||
messages: {
|
||||
ETA: {
|
||||
min : 'ETA must be greater than ETD'
|
||||
minDate : 'ETA must be greater than ETD'
|
||||
}
|
||||
},
|
||||
errorPlacement: function ( error, element ) {
|
||||
@@ -227,7 +233,7 @@
|
||||
},
|
||||
messages: {
|
||||
ETA: {
|
||||
min : 'ETA must be greater than ETD'
|
||||
minDate : 'ETA must be greater than ETD'
|
||||
}
|
||||
},
|
||||
errorPlacement: function ( error, element ) {
|
||||
@@ -252,7 +258,7 @@
|
||||
$(this.$el).find('.shippingForm').valid();
|
||||
this.shippingArrangement.schedule.ETD = date;
|
||||
$(this.$el).find('.shippingForm .ETA').rules("add", {
|
||||
min: moment(this.shippingArrangement.schedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
|
||||
minDate: moment(this.shippingArrangement.schedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -269,7 +275,7 @@
|
||||
$(this.$el).find('.rescheduleShipping').valid();
|
||||
this.reschedule.ETD = date;
|
||||
$(this.$el).find('.rescheduleShipping .ETA').rules("add", {
|
||||
min: moment(this.reschedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
|
||||
minDate: moment(this.reschedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user