ISO date previous weekday
iso-date-previous-weekday · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed
Return the most recent date on or before a given date that falls on a specified ISO weekday.
Use when you need to: iso date previous weekday · last monday before date · preceding weekday.
Supported
- iso date previous weekday
- last monday before date
- preceding weekday
Not supported
- timezones
- locale weekday names
- business day skip
Behavior
- date is a strict YYYY-MM-DD proleptic Gregorian UTC calendar date with year 0001-9999.
- weekday is a JSON integer 1-7 with Monday=1 .. Sunday=7.
- inclusive is an optional boolean, default false. When true and date already falls on weekday, the result is date itself.
- Otherwise the result is the latest date strictly before date whose ISO weekday equals weekday (at most 7 days earlier).
- The call is rejected if the result would fall outside year 0001-9999.
Input
date(string, required): min length 10; max length 10; pattern^\d{4}-\d{2}-\d{2}$weekday(integer, required): min 1; max 7inclusive(boolean, optional)
Output
date(string, required): min length 10; max length 10
Limits
- year min: 1
- year max: 9999
- max days back: 7
Example
Request input:
{
"date": "2026-09-15",
"weekday": 5
}
Response:
{
"result": {
"date": "2026-09-11"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "iso-date-previous-weekday",
"version": "1.0.0",
"input": {
"date": "2026-09-15",
"weekday": 5
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/iso-date-previous-weekday/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"date":"2026-09-15","weekday":5}'
The machine-readable contract is at /v1/tools/iso-date-previous-weekday/versions/1.0.0.
CLI
node cli.mjs run iso-date-previous-weekday 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- ISO date last weekday of month: Return the date of the last occurrence of an ISO weekday within a calendar month.
- ISO date next weekday: Return the next date on or after a given date that falls on a specified ISO weekday.
- ISO date nth weekday of month: Return the date of the nth occurrence of an ISO weekday within a calendar month.
- ISO date weekday occurrences in range: List every date within an inclusive date range that falls on a given ISO weekday.
- ISO date month end: Return the last valid calendar day of the year-month of a YYYY-MM-DD date.
- ISO date to week: Convert a YYYY-MM-DD calendar date to an ISO-8601 week date.