Kendo Date Picker Validator

This is a simple code snippet that would help validate kendo date picker. This will be commonly added and can be used for all the datepickers through out your application.

This also provides you a chance to add custom validation message. The class used is common to all date pickers by default. To be specific you can also use custom class and id whatever suits your requirement.
  1. //Kendo DatePicker Validator  
  2.     $(".k-datepicker").kendoValidator({  
  3.         rules: {  
  4.             //implement your custom date validation  
  5.             dateValidation: function (e) {  
  6.                 console.log("e", e);  
  7.                 var currentDate = Date.parse($(e).val());  
  8.                 //Check if Date parse is successful  
  9.                 if (!currentDate) {  
  10.                     return false;  
  11.                 }  
  12.                 return true;  
  13.             }  
  14.         },  
  15.         messages: {  
  16.             dateValidation: "Invalid date format"  
  17.         }  
  18.     });  
Hope this helps to all the kendo users in any way.