Skip to content

Main content

Reporting Week Date Offset Tool

Locate a supplied civil date on a seven-day grid anchored by an explicit reporting origin.

Loading tool…

Description

Locate a supplied civil date on a seven-day grid anchored by an explicit reporting origin.

Public-health summaries depend on who is counted, which observations are verified, and the period and population used as the base. Shares, weighted contributions, and inventory balances describe supplied records; they do not by themselves establish a health outcome or a clinical recommendation.

Locate a supplied civil date on a seven-day grid anchored by an explicit reporting origin.

When to use this tool

Use it for reporting week date offset when the required inputs and conventions are already available.

How to use the tool and how it works

  1. Enter date, weekOrigin. Use the stated units and boundary conventions.
  2. Run the calculation. Correct any input error before interpreting a result.
  3. Read days, weekIndex, offsetDays. Inspect any known, defined, inclusion, or boundary flags before interpreting numeric values.

Parse date and weekOrigin as exact real YYYY-MM-DD calendar dates at UTC midnight. Divide their day difference into weekIndex=floor(days/7) and nonnegative offsetDays from zero through six.1

Input fieldMeaning and unitsAccepted input
dateDateRequired. Text; maximum UTF-16 length 8192.
weekOriginWeek OriginRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
daysDaysRequired. Safe integer.
weekIndexSigned zero-based seven-day block relative to weekOrigin; not an ISO week number.Required. Safe integer.
offsetDaysNonnegative day position from zero through six within that block.Required. Safe integer.
json
{
  "input": {
    "date": "2024-01-10",
    "weekOrigin": "2024-01-01"
  },
  "output": {
    "days": 9,
    "weekIndex": 1,
    "offsetDays": 2
  }
}

Limitations and assumptions

  • A date before the origin can have a negative weekIndex. This is an origin-based week grid, not automatically an ISO week, epidemiological reporting calendar, or local-time convention.
  • The field tables describe structural bounds; the mechanics also state cross-field requirements. Malformed input shapes, disallowed keys, and invalid domains cause input errors. Results must remain finite and within the declared output contract. A successful false flag or zero placeholder is distinct from an error.
  • Numeric arithmetic uses binary floating point. Exact comparisons have no hidden tolerance or decimal rounding; negative zero is exported as zero. Decimal-text integer operations retain the exactness specifically stated above.

Alternative or Complementary methods

For reporting week date offset, check the source records and the supplied rule before comparing the result with another method. Use an appropriately validated measurement or analysis method for clinical interpretation.

References

  1. Calculation and input contract: public-health/reporting-week-date-offset — tool.io

Similar or alternative tools