Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
clientside_validation
Commits
ac3318b1
Commit
ac3318b1
authored
Jan 07, 2014
by
jelles
Browse files
fix date format validation
parent
10deab52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
clientside_validation.js
clientside_validation.js
+3
-3
clientside_validation_form/clientside_validation_form.module
clientside_validation_form/clientside_validation_form.module
+1
-1
No files found.
clientside_validation.js
View file @
ac3318b1
...
...
@@ -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
){
...
...
clientside_validation_form/clientside_validation_form.module
View file @
ac3318b1
...
...
@@ -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'
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment