Skip to content

Commit 3b03974

Browse files
committed
fix regexp
1 parent 7466733 commit 3b03974

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/cubejs-api-gateway/src/dateParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function dateParser(dateString, timezone, now = new Date()) {
6565
moment.tz(timezone).endOf('day').add(1, 'day')
6666
];
6767
} else if (dateString.match(/^from (.*) to (.*)$/)) {
68-
const [, from, to] = dateString.match(/^from (.*) to (.*)$/);
68+
const [, from, to] = dateString.match(/^from\s{1,3}(.{0,50})\s{1,3}to\s{1,3}(.{0,50})$/);
6969

7070
const current = moment(now).tz(timezone);
7171
const fromResults = parse(from, new Date(current.format(moment.HTML5_FMT.DATETIME_LOCAL_MS)));

0 commit comments

Comments
 (0)