dateRange()

True if the current date is within the given day, month and/or year range.

dateRange(day | month | year ... [, "GMT"])  →  boolean

Accepts many argument forms (day, month, year, or ranges of them). Local time unless “GMT” is the last argument.

Example

if (dateRange("DEC", "JAN")) {
  return "PROXY proxy-holiday.corp.example:8080";
}

Engine notes

EngineBehaviourSource
chromiumSupports wrap-around ranges such as DEC to JAN.code, verified 2026-10-04
services/proxy_resolver/pac_js_library.h@cb6eb0e7
pacparserNo wrap-around ranges.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
dateRangeyesyesyesyesyesyesyes

Related rules