MCPcopy Index your code
hub / github.com/darkreader/darkreader / isInTimeIntervalLocal

Function isInTimeIntervalLocal

src/utils/time.ts:79–87  ·  view source on GitHub ↗
(time0: string, time1: string, date: Date = new Date())

Source from the content-addressed store, hash-verified

77}
78
79export function isInTimeIntervalLocal(time0: string, time1: string, date: Date = new Date()): boolean {
80 const a = parse24HTime(time0);
81 const b = parse24HTime(time1);
82 const t = [date.getHours(), date.getMinutes()];
83 if (compareTime(a, b) > 0) {
84 return compareTime(a, t) <= 0 || compareTime(t, b) < 0;
85 }
86 return compareTime(a, t) <= 0 && compareTime(t, b) < 0;
87}
88
89function isInTimeIntervalUTC(time0: number, time1: number, timestamp: number): boolean {
90 if (time1 < time0) {

Callers 2

updateAutoStateMethod · 0.90
time.tests.tsFile · 0.90

Calls 2

parse24HTimeFunction · 0.85
compareTimeFunction · 0.85

Tested by

no test coverage detected