Skip to content

Main content

Weekday Occurrence Remaining In Month Tool

Compute weekday occurrence remaining in month from explicit bounded inputs.

Loading tool…

Description

Return a date's ordinal occurrence of its weekday within its month and later occurrences.

Civil calendar arithmetic needs explicit year numbering, leap rules and index origins. A weekday mask or Gregorian component operation does not identify a timezone, working calendar or historical calendar reform.

Return a date's ordinal occurrence of its weekday within its month and later occurrences.

When to use this tool

Use Weekday Occurrence Remaining In Month when checking the stated weekday or Gregorian calendar convention.

How to use the tool and how it works

  1. Enter year, month, day. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read occurrence, remaining. Use the output convention below.

Return a date's ordinal occurrence of its weekday within its month and later occurrences. Validate Gregorian year/month/day; occurrence = floor((day-1)/7)+1 and remaining = floor((lastDay-day)/7).1

Input fieldMeaning and unitsAccepted input
yearYearRequired. Safe integer; minimum 1; maximum 9999.
monthMonthRequired. Safe integer; minimum 1; maximum 12.
dayDayRequired. Safe integer; minimum 1; maximum 31.
Output fieldInterpretationReturned shape
occurrenceOccurrenceRequired. Safe integer.
remainingBudget minus use, in the same units; a negative value indicates excess use.Required. Safe integer.
json
{
  "input": {
    "year": 2024,
    "month": 2,
    "day": 15
  },
  "output": {
    "occurrence": 3,
    "remaining": 2
  }
}

Limitations and assumptions

  • Occurrences refer to that date's own weekday, not an arbitrary requested weekday or work calendar.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use an appropriate full calendar library and authoritative local rules when business days, historical dates or real scheduling matter.

References

  1. Calculation and input contract: date/weekday-occurrence-remaining-in-month — tool.io

Similar or alternative tools