Skip to content

Commit 5cc0484

Browse files
authored
Merge pull request #58 from nockhigan/development
Date Comparisons Fail if Compare field is empty
2 parents faa4cd6 + 4f7d156 commit 5cc0484

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

models/validators/AfterOrEqualValidator.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ component
5858
"get#arguments.validationData#"
5959
);
6060
}
61+
62+
// return true if no value to compare against
63+
if ( isNull( compareValue ) || isNullOrEmpty( compareValue ) ) {
64+
return true;
65+
}
6166

6267
/**
6368
* -1 if date1 is before than date2

models/validators/AfterValidator.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ component
5858
"get#arguments.validationData#"
5959
);
6060
}
61+
62+
// return true if no value to compare against
63+
if ( isNull( compareValue ) || isNullOrEmpty( compareValue ) ) {
64+
return true;
65+
}
6166

6267
/**
6368
* -1 if date1 is before than date2

models/validators/BeforeOrEqualValidator.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ component
5858
"get#arguments.validationData#"
5959
);
6060
}
61+
62+
// return true if no value to compare against
63+
if ( isNull( compareValue ) || isNullOrEmpty( compareValue ) ) {
64+
return true;
65+
}
6166

6267
/**
6368
* -1 if date1 is before than date2

models/validators/BeforeValidator.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ component
5858
"get#arguments.validationData#"
5959
);
6060
}
61+
62+
// return true if no value to compare against
63+
if ( isNull( compareValue ) || isNullOrEmpty( compareValue ) ) {
64+
return true;
65+
}
6166

6267
/**
6368
* -1 if date1 is before than date2

models/validators/DateEqualsValidator.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ component
5858
"get#arguments.validationData#"
5959
);
6060
}
61+
62+
// return true if no value to compare against
63+
if ( isNull( compareValue ) || isNullOrEmpty( compareValue ) ) {
64+
return true;
65+
}
6166

6267
/**
6368
* -1 if date1 is before than date2

0 commit comments

Comments
 (0)