Commit ac3318b1 authored by jelles's avatar jelles
Browse files

fix date format validation

parent 10deab52
......@@ -1214,13 +1214,13 @@
var year = parseInt(parts[param.yearpos], 10);
var date = new Date();
var result = true;
if (parts[param.daypos].toString().length !== parts[param.daypos].length){
if (param.daypos !== false && parts[param.daypos].toString().length !== parts[param.daypos].length){
result = false;
}
if (parts[param.monthpos].toString().length !== parts[param.monthpos].length){
if (param.monthpos !== false && parts[param.monthpos].toString().length !== parts[param.monthpos].length){
result = false;
}
if (parts[param.yearpos].toString().length !== parts[param.yearpos].length){
if (param.yearpos !== false && parts[param.yearpos].toString().length !== parts[param.yearpos].length){
result = false;
}
if (param.yearpos !== false){
......
......@@ -205,7 +205,7 @@ function clientside_validation_regular($form_id, $element, &$js_rules, $form_sta
break;
case 'date_popup':
case 'date_text':
$date_title = ($element['#type'] == 'date_popup') ? $element['date']['#title'] : $element['#date_title'];
$date_title = ($element['#type'] == 'date_popup' || !isset($element['#date_title'])) ? $element['date']['#title'] : $element['#date_title'];
if (isset($element['date'])) {
_clientside_validation_set_required($element['date']['#name'], $date_title, isset($element['#required']) ? $element['#required'] : FALSE, $js_rules);
$granularity = date_format_order($element['#date_format']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment