{
  "address": "cb67164bfec903b72a540c00e1bca6f7",
  "category": "other",
  "question": "How many days, weeks and days are there from 2026-09-30 to 2026-12-25?",
  "answer": "86 days (12 weeks and 2 days)",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "chrono-Compatible Low-Level Date Algorithms",
      "url": "https://howardhinnant.github.io/date_algorithms.html"
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "url",
    "value": "https://howardhinnant.github.io/date_algorithms.html",
    "retrieved_utc": "2026-09-30T19:41:35Z"
  },
  "qsha256": "ee2baf38efa4402598560d0584630dc76a46228b922dd067b8350621d0d3503d",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Countdown to a date",
    "version": "1",
    "source_url_or_file": "methods/countdown-to-date.cjs",
    "sha256_of_method_file": "70b844d4d8e297ba24837b668de24117a7344b9600ac253c415f4be7579b641d"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "from_date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 starting date, YYYY-MM-DD"
      },
      {
        "name": "to_date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 target date, YYYY-MM-DD, must be on or after from_date"
      }
    ],
    "outputs": [
      {
        "name": "total_days",
        "unit": "days",
        "description": "Whole days from from_date to to_date"
      },
      {
        "name": "weeks",
        "unit": "weeks",
        "description": "Whole weeks in the total"
      },
      {
        "name": "extra_days",
        "unit": "days",
        "description": "Days left over after the whole weeks"
      }
    ],
    "steps": [
      "Parse from_date and to_date as proleptic Gregorian civil dates and convert both to Julian Day Numbers (Hinnant days_from_civil, cited above).",
      "Require to_date on or after from_date; otherwise the inputs are invalid.",
      "total_days = JDN(to_date) - JDN(from_date).",
      "weeks = floor(total_days / 7); extra_days = total_days mod 7."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "from_date": "2026-09-30",
          "to_date": "2026-12-25"
        },
        "expected": {
          "answer": "86 days (12 weeks and 2 days)"
        },
        "check": "independently: Sep has 30-30=0 remaining, Oct 31 + Nov 30 + Dec 25 = 86 days; 86 = 12*7 + 2"
      },
      {
        "name": "test vector: same date",
        "inputs": {
          "from_date": "2026-01-01",
          "to_date": "2026-01-01"
        },
        "expected": {
          "answer": "0 days (0 weeks and 0 days)"
        },
        "check": "a date has zero days until itself"
      },
      {
        "name": "test vector: across a leap day",
        "inputs": {
          "from_date": "2024-02-01",
          "to_date": "2024-03-01"
        },
        "expected": {
          "answer": "29 days (4 weeks and 1 days)"
        },
        "check": "2024 is a leap year so February has 29 days; 29 = 4*7 + 1"
      }
    ],
    "disclaimer": null,
    "deck_category": "dates"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "url",
          "value": "https://howardhinnant.github.io/date_algorithms.html",
          "retrieved_utc": "2026-09-30T19:41:35Z"
        },
        "sha256": "1138486cb110add076030a6ba49cee10e9dc6f28de1aa9efecfe057f52b5653b",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Countdown to a date",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
