Skip to content

Commit 6a0e2ce

Browse files
author
Marvel Mathew
committed
Precompute seconds multiplication
1 parent f82fff2 commit 6a0e2ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,12 @@ function relativeTimeToDate(text, now = new Date()) {
590590
switch(interval) {
591591
case 'day':
592592
case 'days':
593-
seconds += val * 24 * 60 * 60;
593+
seconds += val * 86400; // 24 * 60 * 60
594594
break;
595595

596596
case 'hour':
597597
case 'hours':
598-
seconds += val * 60 * 60;
598+
seconds += val * 3600; // 60 * 60
599599
break;
600600

601601
case 'minute':

0 commit comments

Comments
 (0)