{
  "schemaVersion": 1,
  "slug": "weeks-calculator",
  "category": "date-time",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "c3339cd27cb859f37caa848c1df5996d00d391a55518e5dd596aea2f86545862",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/weeks-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "result = value × F[from] ÷ F[to]",
    "vars": [
      [
        "value",
        "Amount to convert"
      ],
      [
        "from",
        "Original unit"
      ],
      [
        "to",
        "Target unit"
      ],
      [
        "F",
        "Factor relative to one week"
      ]
    ],
    "note": "F: week 1, day 1/7, hour 1/168, minute 1/10080, second 1/604800, month 30.4375/7, year 365.2425/7; 5 working days per week."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const F={weeks:1,days:1/7,hours:1/168,minutes:1/10080,seconds:1/604800,months:30.4375/7,years:365.2425/7}; const weeks=value*F[from]; return { result: weeks/F[to], days: weeks*7, hours: weeks*168, minutes: weeks*10080, workingDays: weeks*5 };",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 6,
        "min": -1000000000,
        "max": 1000000000,
        "step": 0.01
      },
      {
        "name": "from",
        "type": "select",
        "default": "weeks",
        "options": [
          {
            "value": "weeks"
          },
          {
            "value": "days"
          },
          {
            "value": "hours"
          },
          {
            "value": "minutes"
          },
          {
            "value": "seconds"
          },
          {
            "value": "months"
          },
          {
            "value": "years"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "days",
        "options": [
          {
            "value": "weeks"
          },
          {
            "value": "days"
          },
          {
            "value": "hours"
          },
          {
            "value": "minutes"
          },
          {
            "value": "seconds"
          },
          {
            "value": "months"
          },
          {
            "value": "years"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 6,
        "unit": ""
      },
      {
        "name": "days",
        "precision": 4,
        "unit": "days"
      },
      {
        "name": "hours",
        "precision": 2,
        "unit": "h"
      },
      {
        "name": "minutes",
        "precision": 2,
        "unit": "min"
      },
      {
        "name": "workingDays",
        "precision": 2,
        "unit": "days"
      }
    ],
    "interpret": null
  }
}
