@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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @7365admin1/module-hygiene
2
2
 
3
+ ## 4.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Update module hygiene
8
+
3
9
  ## 4.26.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -2555,6 +2555,7 @@ function MParentChecklist(value) {
2555
2555
 
2556
2556
  // src/repositories/hygiene-parent-checklist.repository.ts
2557
2557
  var import_mongodb7 = require("mongodb");
2558
+ var import_moment_timezone2 = __toESM(require("moment-timezone"));
2558
2559
  var import_node_server_utils14 = require("@7365admin1/node-server-utils");
2559
2560
  var import_core7 = require("@7365admin1/core");
2560
2561
  function useParentChecklistRepo() {
@@ -2849,19 +2850,28 @@ function useParentChecklistRepo() {
2849
2850
  query.$text = { $search: search };
2850
2851
  cacheOptions.search = search;
2851
2852
  }
2853
+ const singaporeTz = "Asia/Singapore";
2854
+ const normalizedStartDate = typeof startDate === "string" ? startDate : (0, import_moment_timezone2.default)(startDate).tz(singaporeTz).format("YYYY-MM-DD");
2855
+ const normalizedEndDate = typeof endDate === "string" ? endDate : (0, import_moment_timezone2.default)(endDate).tz(singaporeTz).format("YYYY-MM-DD");
2852
2856
  if (startDate && endDate) {
2857
+ const startOfDay = import_moment_timezone2.default.tz(normalizedStartDate, "YYYY-MM-DD", singaporeTz).startOf("day").toDate();
2858
+ const endOfDay = import_moment_timezone2.default.tz(normalizedEndDate, "YYYY-MM-DD", singaporeTz).endOf("day").toDate();
2853
2859
  query.createdAt = {
2854
- $gte: new Date(startDate),
2855
- $lte: new Date(endDate)
2860
+ $gte: startOfDay,
2861
+ $lte: endOfDay
2856
2862
  };
2857
- cacheOptions.startDate = new Date(startDate).toISOString().split("T")[0];
2858
- cacheOptions.endDate = new Date(endDate).toISOString().split("T")[0];
2863
+ cacheOptions.startDate = normalizedStartDate;
2864
+ cacheOptions.endDate = normalizedEndDate;
2859
2865
  } else if (startDate) {
2860
- query.createdAt = { $gte: new Date(startDate) };
2861
- cacheOptions.startDate = new Date(startDate).toISOString().split("T")[0];
2866
+ query.createdAt = {
2867
+ $gte: import_moment_timezone2.default.tz(normalizedStartDate, "YYYY-MM-DD", singaporeTz).startOf("day").toDate()
2868
+ };
2869
+ cacheOptions.startDate = normalizedStartDate;
2862
2870
  } else if (endDate) {
2863
- query.createdAt = { $lte: new Date(endDate) };
2864
- cacheOptions.endDate = new Date(endDate).toISOString().split("T")[0];
2871
+ query.createdAt = {
2872
+ $lte: import_moment_timezone2.default.tz(normalizedEndDate, "YYYY-MM-DD", singaporeTz).endOf("day").toDate()
2873
+ };
2874
+ cacheOptions.endDate = normalizedEndDate;
2865
2875
  }
2866
2876
  if (status && status !== "all") {
2867
2877
  query.status = status;