c2-mongoose 2.1.195 → 2.1.196

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -479,18 +479,18 @@ var SearchFlow = /** @class */ (function () {
479
479
  var fieldName = key.replace('Range', '');
480
480
  var values = value;
481
481
  if ((0, Utils_1.isNotEmpty)(values[0])) {
482
- var momentValue = (0, moment_timezone_1.default)(values[0]).tz('America/Sao_Paulo', false);
482
+ var momentValue = (0, moment_timezone_1.default)(values[0]);
483
483
  momentValue.hour(0);
484
484
  momentValue.minute(0);
485
485
  momentValue.second(0);
486
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.toDate() });
486
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.tz('America/Sao_Paulo', false).toDate() });
487
487
  }
488
488
  if ((0, Utils_1.isNotEmpty)(values[1])) {
489
- var momentValue = (0, moment_timezone_1.default)(values[1]).tz('America/Sao_Paulo', false);
489
+ var momentValue = (0, moment_timezone_1.default)(values[1]);
490
490
  momentValue.hour(23);
491
491
  momentValue.minute(59);
492
492
  momentValue.second(59);
493
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.toDate() });
493
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.tz('America/Sao_Paulo', false).toDate() });
494
494
  }
495
495
  filters.$and.push(condition);
496
496
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.195",
3
+ "version": "2.1.196",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -423,24 +423,24 @@ abstract class SearchFlow {
423
423
  var fieldName = key.replace('Range', '')
424
424
  var values = value as any
425
425
  if (isNotEmpty(values[0])) {
426
- var momentValue = moment(values[0]).tz('America/Sao_Paulo', false)
426
+ var momentValue = moment(values[0])
427
427
  momentValue.hour(0)
428
428
  momentValue.minute(0)
429
429
  momentValue.second(0)
430
430
  condition[fieldName] = {
431
431
  ...condition[fieldName],
432
- $gte: momentValue.toDate()
432
+ $gte: momentValue.tz('America/Sao_Paulo', false).toDate()
433
433
  }
434
434
  }
435
435
 
436
436
  if (isNotEmpty(values[1])) {
437
- var momentValue = moment(values[1]).tz('America/Sao_Paulo', false)
437
+ var momentValue = moment(values[1])
438
438
  momentValue.hour(23)
439
439
  momentValue.minute(59)
440
440
  momentValue.second(59)
441
441
  condition[fieldName] = {
442
442
  ...condition[fieldName],
443
- $lte: momentValue.toDate()
443
+ $lte: momentValue.tz('America/Sao_Paulo', false).toDate()
444
444
  }
445
445
  }
446
446
  filters.$and.push(condition)