Skip to content

Main content

Personal Health Streak Grace Day

Count completed days backward through at most an explicit grace-day budget, excluding grace days from the completion count.

Loading tool…

Description

Count completed days backwards through a supplied allowance of missed grace days.

Personal health logs distinguish observed events, unknown entries, device/source identifiers and chosen day or streak boundaries. A numerical activity duration or recorded symptom label organizes supplied data rather than diagnosing a condition. Fixed 86400-second days differ from civil days affected by timezone and daylight-saving changes.

Count completed days backwards through a supplied allowance of missed grace days.

When to use this tool

Use Personal Health Streak Grace Day when checking the stated personal-log, missingness, time or streak convention.

How to use the tool and how it works

  1. Enter completedDays, graceDayBudget. 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 currentStreak, graceDaysUsed. Use the output convention below.

Require whole graceDayBudget>=0. Scan completedDays backward; count true entries, allow up to the budget of false entries, and stop at the next false. Return completed-day count and grace days used separately.1

Input fieldMeaning and unitsAccepted input
completedDaysCompleted DaysRequired. Array of boolean; maximum items 256.
graceDayBudgetGrace Day BudgetRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
currentStreakCompleted true days counted during the backward scan, excluding allowed false grace days.Required. Safe integer.
graceDaysUsedFalse days consumed within the supplied budget before the terminating break.Required. Safe integer.
json
{
  "input": {
    "completedDays": [
      true,
      false,
      true,
      false,
      true
    ],
    "graceDayBudget": 1
  },
  "output": {
    "currentStreak": 2,
    "graceDaysUsed": 1
  }
}

Limitations and assumptions

  • Grace days do not increase currentStreak; they need not be consecutive and the list's chronology and health goals are supplied rather than evaluated.
  • 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

Review original records and calibrated devices; consult qualified health professionals for symptoms, interpretation or actual care decisions.

References

  1. Calculation and input contract: health/personal-health-streak-grace-day — tool.io

Similar or alternative tools