{
  "id": "days-until-monday",
  "version": "6e64c93b16a0",
  "status": "published",
  "name": "Days Until Monday",
  "question": "Days until Monday",
  "summary": "Counts the days from today, or any date you choose, to the next Monday, with its date and the Monday after it.",
  "category": "days",
  "subcategory": "countdowns",
  "url": "https://www.acalculator.org/days/days-until-monday",
  "markdown": "https://www.acalculator.org/days/days-until-monday.md",
  "kind": "function",
  "method": "Days until Monday = (1 − the start date’s weekday + 7) mod 7, with Sunday = 0, Monday = 1, …, Saturday = 6.",
  "assumptions": [
    "On a Monday, the count is 0; the Monday after is 7 days away.",
    "The start date itself is not counted: from the day before, the count is 1.",
    "Dates are calendar days with no time of day, so a time zone or a daylight-saving change never adds or loses a day.",
    "Start dates from January 1, 1900 to December 31, 2400 work."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "from": {
        "title": "Count from",
        "description": "The date to count from. Today, unless you change it.",
        "type": "string",
        "format": "date"
      }
    }
  },
  "outputs": {
    "days": {
      "label": "Days until Monday",
      "description": "Whole days from the start date to the next Monday; 0 when the start date is a Monday.",
      "format": "integer"
    },
    "date": {
      "label": "Next Monday",
      "description": "The next Monday on or after the start date.",
      "format": "date"
    },
    "after": {
      "label": "The Monday after",
      "description": "The Monday one week later.",
      "format": "date"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "from": "2026-09-30"
    },
    "outputs": {
      "days": 5,
      "date": "2026-10-05",
      "after": "2026-10-12"
    },
    "text": "From September 30, 2026, there are 5 days until Monday, October 5, 2026."
  },
  "examples": [
    {
      "given": {
        "from": "2026-09-28"
      },
      "expect": {
        "date": "2026-09-28",
        "days": 0
      },
      "source": "U.S. Naval Observatory, Leap Years: the Gregorian leap year rule (https://aa.usno.navy.mil/faq/leap_years); Python 3 datetime: the next date on or after the start whose weekday() matches (docs/progress/WP-45/truth.py)"
    },
    {
      "given": {
        "from": "2026-12-31"
      },
      "expect": {
        "date": "2027-01-04",
        "days": 4
      },
      "source": "U.S. Naval Observatory, Leap Years: the Gregorian leap year rule (https://aa.usno.navy.mil/faq/leap_years); Python 3 datetime: the next date on or after the start whose weekday() matches (docs/progress/WP-45/truth.py)"
    },
    {
      "given": {
        "from": "2028-02-27"
      },
      "expect": {
        "date": "2028-02-28",
        "days": 1
      },
      "source": "U.S. Naval Observatory, Leap Years: the Gregorian leap year rule (https://aa.usno.navy.mil/faq/leap_years); Python 3 datetime: the next date on or after the start whose weekday() matches (docs/progress/WP-45/truth.py)"
    }
  ],
  "sources": [],
  "related": [
    "days-until-sunday",
    "days-until-tuesday",
    "days-until",
    "days-from-today"
  ],
  "changelog": []
}
