{
  "address": "64d7245fc1c632513712b6898bbf4665",
  "category": "other",
  "question": "What date is 31 days after 2024-01-01?",
  "answer": "2024-02-01",
  "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": "ed70473b6a2a6a533cff8cf3664429a40f2d2cabb75734e70958cedefa0d521b",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Add days to a date",
    "version": "1",
    "source_url_or_file": "methods/add-days-to-date.cjs",
    "sha256_of_method_file": "d770809d18f84cb8bec3f5875d2f1134d12d3a187b21a282c73b7bdf26fa1718"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 starting date, YYYY-MM-DD"
      },
      {
        "name": "days",
        "type": "integer",
        "required": true,
        "description": "Number of days to add; negative subtracts days"
      }
    ],
    "outputs": [
      {
        "name": "result_date",
        "format": "date",
        "description": "The resulting ISO 8601 date"
      }
    ],
    "steps": [
      "Parse the date as a proleptic Gregorian civil date.",
      "Convert it to a day-number using the Hinnant days_from_civil algorithm (cited above).",
      "Add the signed integer days to the day-number.",
      "Convert the resulting day-number back to a civil (year, month, day) using the inverse civil_from_days algorithm.",
      "Format the result as an ISO 8601 date."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "date": "2024-01-01",
          "days": 31
        },
        "expected": {
          "answer": "2024-02-01"
        },
        "check": "January has 31 days, so 31 days after Jan 1 lands on Feb 1"
      },
      {
        "name": "test vector: leap day backward",
        "inputs": {
          "date": "2024-03-01",
          "days": -1
        },
        "expected": {
          "answer": "2024-02-29"
        },
        "check": "2024 is a leap year, so the day before March 1, 2024 is Feb 29, 2024"
      },
      {
        "name": "test vector: year rollover",
        "inputs": {
          "date": "2023-12-31",
          "days": 1
        },
        "expected": {
          "answer": "2024-01-01"
        },
        "check": "the day after Dec 31 is always Jan 1 of the next year"
      }
    ],
    "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": "8669cee28880a1feedbdff76c9364040e2f8a4aa3c730b926a2e67f36b216414",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Add days to a date",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
