Skip to content

Commit 81bab83

Browse files
committed
small improvement in BaseFilter format*Date
1 parent df32aab commit 81bab83

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/cubejs-schema-compiler/src/adapter/BaseFilter.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ export class BaseFilter extends BaseDimension {
394394
} else {
395395
throw new Error(`Unsupported timestamp precision: ${this.query.timestampPrecision()}`);
396396
}
397-
}
398397

399-
if (date && date.match(dateRegex)) {
400-
return `${date}T00:00:00.${'0'.repeat(this.query.timestampPrecision())}`;
398+
if (date.match(dateRegex)) {
399+
return `${date}T00:00:00.${'0'.repeat(this.query.timestampPrecision())}`;
400+
}
401401
}
402402

403403
if (!date) {
@@ -434,10 +434,10 @@ export class BaseFilter extends BaseDimension {
434434
} else {
435435
throw new Error(`Unsupported timestamp precision: ${this.query.timestampPrecision()}`);
436436
}
437-
}
438437

439-
if (date && date.match(dateRegex)) {
440-
return `${date}T23:59:59.${'9'.repeat(this.query.timestampPrecision())}`;
438+
if (date.match(dateRegex)) {
439+
return `${date}T23:59:59.${'9'.repeat(this.query.timestampPrecision())}`;
440+
}
441441
}
442442

443443
if (!date) {

0 commit comments

Comments
 (0)