ForHosting KIT · Dates & time

Previous weekday occurrence

The last Monday before Friday 24 July 2026 is 20 July 2026, four days back. Enter a date and a weekday to get its most recent earlier occurrence; if the date already is that weekday, you go back a full week. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Date
2026-07-24
Target weekday: English name
Monday
You get
Date
2026-07-20
Previous date
2026-07-20
Reference date
2026-07-24
Year
2,026

A previous weekday occurrence calculator answers a planning question people ask constantly: what was the last Monday before a deadline, the most recent Friday before a launch, or the prior Sunday before an invoice date? Enter a Gregorian ISO calendar date and a target weekday as an English name or an ISO number from one through seven, and this tool returns the exact calendar date of that most recent strictly earlier occurrence, plus how many days you stepped back, weekday labels, the ISO weekday number, and a short step list you can audit.

What “previous occurrence of a weekday” means on the Gregorian calendar

Given a reference calendar day and a weekday name, the previous occurrence is the latest day that falls on that weekday and is strictly before the reference. If the reference itself is already a Monday and you asked for Monday, the answer is seven days earlier—not the same day—because “previous” means earlier, not “on or before.”

If the reference is a Saturday and you asked for Friday, the answer is one day earlier; if you asked for Wednesday, you step back three days, and so on, always at most seven days. Weekday numbering in the response follows the ISO convention used across many business systems: Monday is one, Tuesday is two, continuing through Sunday as seven. That is different from libraries that treat Sunday as zero, which is why the response also exposes a Sunday-origin index for callers that need it.

Leap years and month lengths matter only when the walk-back crosses February twenty-ninth or month boundaries: the engine subtracts days with full Gregorian rules so a step from early March into late February lands on a real calendar day.

Practical tips, limits, and related searches

Prefer full English weekday names when humans type into a form, and ISO numbers one through seven when another system already stores Monday-first week indices. Round-trip checks are easy: take the returned ISO date, run it through a day-of-week calculator, and confirm the weekday name matches and that it is strictly before the reference with no intervening day of the same name. Year bounds stop at nine thousand nine hundred ninety-nine to keep four-digit ISO strings well defined for this product surface.

This landing targets people searching for the previous occurrence of a weekday, last Monday before a date, or previous Friday calculator online; it is not a next-weekday finder, not a last-weekday-of-month tool, and not a full date-difference or age calculator.

Prefer this capability when you already have a full ISO date and a weekday name and only need the prior occurrence; if you only need the weekday name of a date, use the day-of-the-week calculator instead, and if you need the final Monday of a given month without a reference day, use the last weekday of the month tool.

Deadline and cutoff back-dating

Operations teams resolve “last Friday before the launch date” or “previous Monday before payroll close” into a concrete ISO date for calendars and reminder jobs.

Classroom calendar exercises

Students check hand-written “previous Tuesday before …” answers against a fixed Gregorian result, including month-boundary and same-weekday cases.

What does previous occurrence of a weekday mean?

It is the most recent calendar day that falls on the weekday you specify and is strictly before your reference ISO date—for example, the previous Monday before 2026-07-24.

What if the reference date is already that weekday?

The result is seven days earlier. Previous means strictly earlier, so the same day is never returned.

Which date formats are accepted?

Exactly YYYY-MM-DD as a real Gregorian calendar day.

Is the previous weekday calculator free?

The browser tool is free and runs locally.

How far back can the answer be?

Between one and seven days. From a Saturday, Friday is one day back and Wednesday three, while the same weekday is a full seven days earlier, so the answer always lies within the past week.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/date/previous-weekday

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/date/previous-weekday \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-07-24","weekday":"Monday"}'
{
  "date": "2026-07-24",
  "weekday": "Monday"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "date.previous_weekday",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

year_min1
year_max9999
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Unrecognised weekday names, malformed dates, and impossible calendar days are rejected with a clear invalid_input error instead of a silent wrong day.

What “previous occurrence of a weekday” means on the Gregorian calendar

Because the computation never calls the host clock, a request for the previous Friday before twenty twenty-six July twenty-fourth always yields the same ISO string whether you run it in Tokyo, New York, or on a Worker at the edge. This capability is about one reference date and one weekday name—not about business-day calendars, bank holidays, or “previous working day” policies that skip weekends by local rule.

How to call the API and what comes back

Send a JSON body with two required fields: date as an ISO calendar string exactly YYYY-MM-DD, and weekday as an English long or short name such as Monday or Mon, or as an ISO weekday number from one through seven where Monday is one and Sunday is seven. Aliases exist for convenience: iso_date, value, or from for date, and day, dow, day_of_week, or target for weekday. On success the response sets date and previous_date to the canonical ISO calendar string of the earlier weekday, echoes reference_date as the normalised input, sets year, month, and day for the result, day_name and day_name_short for English labels, iso_weekday and day_of_week to the same ISO integer, weekday_0_sunday to the zero-through-six index, days_back to how many calendar days were subtracted, reference_day_name and reference_iso_weekday for the input day, leap_year for the result year, and includes a short message plus an ordered steps array that restates the reference weekday, the target, the offset, and the final date. Failed validation—missing fields, non-ISO date strings, impossible calendar days, or unrecognised weekday tokens—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Always send a real calendar date: thirty-one February and month thirteen are rejected, which is intentional so silent off-by-one bugs do not ship a wrong prior Monday. When teaching or testing, keep a small known set: a mid-week reference asking for the previous Monday, a reference that already is the target weekday so the offset is seven, a walk-back that crosses a month boundary, and a deliberate failure with an unrecognised weekday token such as Funday to prove the hard invalid_input path. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when callers deliberately send bad weekday tokens.

Scheduler and UI fixture generation

Engineers build deterministic previous-weekday fixtures for unit tests without depending on the host clock or timezone.

What happens if the weekday name is unrecognised?

The request is rejected with invalid_input. Use an English name (Monday…Sunday or Mon…Sun) or an ISO number 1–7 (Monday=1 … Sunday=7).

Read the full KIT documentation →