weekdayRange()

True on the given weekday or within the weekday range (SUN, MON, ... SAT). Local time unless "GMT" is passed.

weekdayRange(wd1 [, wd2] [, "GMT"])  →  boolean

Time-dependent PACs are hard to test and behave differently per engine; the checker evaluates them at a fixed “now” so results are reproducible.

Example

if (weekdayRange("MON", "FRI")) {
  return "PROXY proxy.corp.example:8080";
}

Engine notes

EngineBehaviourSource
chromiumSupports wrap-around ranges such as FRI to MON.code, verified 2026-10-04
services/proxy_resolver/pac_js_library.h@cb6eb0e7
firefoxSupports wrap-around ranges.code, verified 2026-10-04
netwerk/base/ascii_pac_utils.js@3f73c528
pacparserNo wrap-around: a range like FRI to MON never matches.code, verified 2026-10-04
src/pac_utils.h@v1.5.3

Availability

Derived from each engine's vendored helper library plus its native bindings (see engines).
Functionchromium
<=51
chromium
>=52
firefox
all
pacparser
<=1.4.6
pacparser
1.5.0
pacparser
>=1.5.1
reference
all
weekdayRangeyesyesyesyesyesyesyes

Related rules