@7365admin1/module-hygiene 4.26.0 → 4.27.0

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.
package/dist/index.mjs CHANGED
@@ -2505,6 +2505,7 @@ function MParentChecklist(value) {
2505
2505
 
2506
2506
  // src/repositories/hygiene-parent-checklist.repository.ts
2507
2507
  import { ObjectId as ObjectId7 } from "mongodb";
2508
+ import moment2 from "moment-timezone";
2508
2509
  import {
2509
2510
  useAtlas as useAtlas5,
2510
2511
  InternalServerError as InternalServerError4,
@@ -2807,19 +2808,28 @@ function useParentChecklistRepo() {
2807
2808
  query.$text = { $search: search };
2808
2809
  cacheOptions.search = search;
2809
2810
  }
2811
+ const singaporeTz = "Asia/Singapore";
2812
+ const normalizedStartDate = typeof startDate === "string" ? startDate : moment2(startDate).tz(singaporeTz).format("YYYY-MM-DD");
2813
+ const normalizedEndDate = typeof endDate === "string" ? endDate : moment2(endDate).tz(singaporeTz).format("YYYY-MM-DD");
2810
2814
  if (startDate && endDate) {
2815
+ const startOfDay = moment2.tz(normalizedStartDate, "YYYY-MM-DD", singaporeTz).startOf("day").toDate();
2816
+ const endOfDay = moment2.tz(normalizedEndDate, "YYYY-MM-DD", singaporeTz).endOf("day").toDate();
2811
2817
  query.createdAt = {
2812
- $gte: new Date(startDate),
2813
- $lte: new Date(endDate)
2818
+ $gte: startOfDay,
2819
+ $lte: endOfDay
2814
2820
  };
2815
- cacheOptions.startDate = new Date(startDate).toISOString().split("T")[0];
2816
- cacheOptions.endDate = new Date(endDate).toISOString().split("T")[0];
2821
+ cacheOptions.startDate = normalizedStartDate;
2822
+ cacheOptions.endDate = normalizedEndDate;
2817
2823
  } else if (startDate) {
2818
- query.createdAt = { $gte: new Date(startDate) };
2819
- cacheOptions.startDate = new Date(startDate).toISOString().split("T")[0];
2824
+ query.createdAt = {
2825
+ $gte: moment2.tz(normalizedStartDate, "YYYY-MM-DD", singaporeTz).startOf("day").toDate()
2826
+ };
2827
+ cacheOptions.startDate = normalizedStartDate;
2820
2828
  } else if (endDate) {
2821
- query.createdAt = { $lte: new Date(endDate) };
2822
- cacheOptions.endDate = new Date(endDate).toISOString().split("T")[0];
2829
+ query.createdAt = {
2830
+ $lte: moment2.tz(normalizedEndDate, "YYYY-MM-DD", singaporeTz).endOf("day").toDate()
2831
+ };
2832
+ cacheOptions.endDate = normalizedEndDate;
2823
2833
  }
2824
2834
  if (status && status !== "all") {
2825
2835
  query.status = status;