Skip to content

Main content

Calendar Week Span Overlap Tool

Intersect two supplied seven-day calendar spans using half-open absolute-day bounds.

Loading tool…

Description

Return overlap of two fixed seven-day spans.

Date labels and intervals depend on origins, endpoint inclusion and calendar versus elapsed-time conventions. Numeric serial periods and local token formats can represent useful bookkeeping without resolving a real instant or official fiscal rule.

Return overlap of two fixed seven-day spans.

When to use this tool

Use Calendar Week Span Overlap when checking a supplied date-label, duration or interval convention.

How to use the tool and how it works

  1. Enter firstStartDay, secondStartDay. 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 overlapDays, firstEndExclusive, secondEndExclusive. Use the output convention below.

Return overlap of two fixed seven-day spans. overlapDays = max(0,7-abs(secondStartDay-firstStartDay)); each end-exclusive coordinate is start+7.1

Input fieldMeaning and unitsAccepted input
firstStartDayFirst Start DayRequired. Safe integer.
secondStartDaySecond Start DayRequired. Safe integer.
Output fieldInterpretationReturned shape
overlapDaysOverlap DaysRequired. Safe integer.
firstEndExclusiveFirst End ExclusiveRequired. Safe integer.
secondEndExclusiveSecond End ExclusiveRequired. Safe integer.
json
{
  "input": {
    "firstStartDay": 100,
    "secondStartDay": 103
  },
  "output": {
    "overlapDays": 4,
    "firstEndExclusive": 107,
    "secondEndExclusive": 110
  }
}

Limitations and assumptions

  • These numeric starts share one day basis; no ISO week or real calendar is determined.
  • 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 a complete date/time implementation and the applicable calendar policy for actual scheduling and interval interpretation.

References

  1. Calculation and input contract: date/calendar-week-span-overlap — tool.io

Similar or alternative tools