@factorypure/client-helpers 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { subDays } from "date-fns";
1
+ import { startOfDay, subDays } from "date-fns";
2
2
  // @ts-ignore
3
3
  import { Index } from "flexsearch";
4
4
  // @ts-ignore
@@ -240,7 +240,7 @@ const filterDateWindow = (results, dayWindow) => {
240
240
  if (!dayWindow)
241
241
  return true;
242
242
  const itemDate = new Date(item.created_at);
243
- const variantDate = subDays(new Date(), Number(dayWindow) || 7);
243
+ const variantDate = startOfDay(subDays(new Date(), Number(dayWindow) || 7));
244
244
  return itemDate >= variantDate;
245
245
  });
246
246
  return filtered;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorypure/client-helpers",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",