@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 +6 -0
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
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:
|
|
2855
|
-
$lte:
|
|
2860
|
+
$gte: startOfDay,
|
|
2861
|
+
$lte: endOfDay
|
|
2856
2862
|
};
|
|
2857
|
-
cacheOptions.startDate =
|
|
2858
|
-
cacheOptions.endDate =
|
|
2863
|
+
cacheOptions.startDate = normalizedStartDate;
|
|
2864
|
+
cacheOptions.endDate = normalizedEndDate;
|
|
2859
2865
|
} else if (startDate) {
|
|
2860
|
-
query.createdAt = {
|
|
2861
|
-
|
|
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 = {
|
|
2864
|
-
|
|
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;
|