c2-mongoose 2.1.13 → 2.1.14

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.
@@ -257,7 +257,7 @@ var SearchFlow = /** @class */ (function () {
257
257
  }
258
258
  if ((0, Utils_1.isNotEmpty)(values[1])) {
259
259
  var momentValue = (0, moment_1.default)(values[1]);
260
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.toDate() });
260
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.toDate().setHours(23, 59, 59) });
261
261
  }
262
262
  filters.$and.push(condition);
263
263
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
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",
@@ -170,7 +170,7 @@ abstract class SearchFlow {
170
170
  return
171
171
  }
172
172
 
173
- if (key.endsWith('DateRange') || key.endsWith('DateTimeRange') ) {
173
+ if (key.endsWith('DateRange') || key.endsWith('DateTimeRange')) {
174
174
  var fieldName = key.replace('Range', '')
175
175
  var values = value as any
176
176
  if (isNotEmpty(values[0])) {
@@ -185,7 +185,7 @@ abstract class SearchFlow {
185
185
  var momentValue = moment(values[1])
186
186
  condition[fieldName] = {
187
187
  ...condition[fieldName],
188
- $lte: momentValue.toDate()
188
+ $lte: momentValue.toDate().setHours(23, 59, 59)
189
189
  }
190
190
  }
191
191
  filters.$and.push(condition)