Skip to content

Commit d84c1b0

Browse files
author
Ville Jyrkkä
committed
Compare only if we have both Dates
1 parent 79dfe22 commit d84c1b0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

metadata/collection/schema.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ ApiMetadata.schema = new SimpleSchema({
6767
const validUntil = this.value;
6868

6969
// validUntil must be after validSince
70-
if (validUntil < validSince) {
70+
if (
71+
(validSince instanceof Date) &&
72+
(validUntil instanceof Date) &&
73+
validUntil < validSince
74+
) {
7175
validation = 'dateError';
7276
}
7377
return validation;

0 commit comments

Comments
 (0)