diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index cef8747..1a979e8 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -19,6 +19,12 @@ : Function('return this')() ; + // form validation for type 'date' + // note that Semantic passes the date as it's shown as a string, so we have to convert to date to validate + $.fn.form.settings.rules.date = function(value) { + return value && typeof value == "string" && value.length > 6 && !isNaN(new Date(value).getTime()); + } + $.fn.calendar = function (parameters) { var