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.
-
- $(".k-datepicker").kendoValidator({
- rules: {
-
- dateValidation: function (e) {
- console.log("e", e);
- var currentDate = Date.parse($(e).val());
-
- if (!currentDate) {
- return false;
- }
- return true;
- }
- },
- messages: {
- dateValidation: "Invalid date format"
- }
- });
Hope this helps to all the kendo users in any way.