mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:51:24 +00:00
fix(heartbeat): return false for zero-width active-hours window (#21408)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 993860bd03
Co-authored-by: adhitShet <131381638+adhitShet@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -39,7 +39,7 @@ describe("isWithinActiveHours", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("returns true when activeHours start equals end", () => {
|
||||
it("returns false when activeHours start equals end", () => {
|
||||
const cfg = cfgWithUserTimezone("UTC");
|
||||
expect(
|
||||
isWithinActiveHours(
|
||||
@@ -47,7 +47,7 @@ describe("isWithinActiveHours", () => {
|
||||
heartbeatWindow("08:00", "08:00", "UTC"),
|
||||
Date.UTC(2025, 0, 1, 12, 0, 0),
|
||||
),
|
||||
).toBe(true);
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("respects user timezone windows for normal ranges", () => {
|
||||
|
||||
@@ -83,7 +83,7 @@ export function isWithinActiveHours(
|
||||
return true;
|
||||
}
|
||||
if (startMin === endMin) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
const timeZone = resolveActiveHoursTimezone(cfg, active.timezone);
|
||||
|
||||
Reference in New Issue
Block a user