Z28687

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z28687"
    },
    "Z2K2": {
        "Z1K1": "Z64",
        "Z64K1": "Z28687",
        "Z64K2": "Z6064",
        "Z64K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z28687( Z28687K1 ) {\n\t// Assumes that Z6064.Z6064K1.Z6061K1 is a Gregorian date (Z20420);\n\t// that's ensured by Wikifunctions fetch code (for now)\n\n\tfunction makeVoid() {\n\t\treturn { \"Z1K1\": \"Z9\",\"Z9K1\": \"Z24\" };\n\t}\n\n\t// Construct an instance of Z20420/Gregorian calendar date\n\t// Copied from Z20448 (changing the function and argument names,\n\t// and checking for month === null)\n\tfunction toGregorianCalendarDate( jsDate ) {\n\t\tlet era = \"Z17814\";\n\t\tlet year = jsDate.K1;\n\t\tif (jsDate.K1 \u003C 1n) {\n\t\t\tera = \"Z17815\";\n\t\t\tyear = ( year * -1n ) + 1n;\n\t\t}\n\t\tyear = year.toString();\n\n\t\tlet month;\n\t\tif ( jsDate.K2 === null ) {\n\t\t\tmonth = makeVoid();\n\t\t} else {\n\t\t\tmonth = {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z16098\"\n\t\t\t\t},\n\t\t\t\t\"Z16098K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": `Z${(jsDate.K2 + 16101).toString()}`\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet day = jsDate.K3.toString();\n\n\t\treturn {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": \"Z20420\"\n\t\t\t},\n\t\t\t\"Z20420K1\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z20159\"\n\t\t\t\t},\n\t\t\t\t\"Z20159K1\": {\n\t\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\t\"Z9K1\": \"Z17813\"\n\t\t\t\t\t},\n\t\t\t\t\t\"Z17813K1\": {\n\t\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\t\"Z9K1\": era\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"Z20159K2\": {\n\t\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\t\"Z9K1\": \"Z13518\"\n\t\t\t\t\t},\n\t\t\t\t\t\"Z13518K1\": {\n\t\t\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\t\t\"Z6K1\": year\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"Z20420K2\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z20342\"\n\t\t\t\t},\n\t\t\t\t\"Z20342K1\": month,\n\t\t\t\t\"Z20342K2\": {\n\t\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\t\"Z9K1\": \"Z13518\"\n\t\t\t\t\t},\n\t\t\t\t\t\"Z13518K1\": {\n\t\t\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\t\t\"Z6K1\": day\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// Construct an instance of Z6060/Time of day\n\t// Copied from Z25178 (changing just the function and argument names)\n\tfunction toTimeOfDay( jsTimeOfDay ) {\n\t\tlet hour = jsTimeOfDay.K1.toString();\n\t\tlet minute = jsTimeOfDay.K2.toString();\n\t\tlet second = jsTimeOfDay.K3.toString();\n\n\t\treturn {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": \"Z6060\"\n\t\t\t},\n\t\t\t\"Z6060K1\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z13518\"\n\t\t\t\t},\n\t\t\t\t\"Z13518K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\t\"Z6K1\": hour\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"Z6060K2\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z13518\"\n\t\t\t\t},\n\t\t\t\t\"Z13518K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\t\"Z6K1\": minute\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"Z6060K3\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z13518\"\n\t\t\t\t},\n\t\t\t\t\"Z13518K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\t\"Z6K1\": second\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// Construct an instance of the given lightweight enum type\n\tfunction toLightweightEnumItemInstance( ZIDForType, QID ) {\n\t\tconst enumInstance = {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": ZIDForType\n\t\t\t}\n\t\t};\n\t\tenumInstance[ ZIDForType + ' K1' ] = {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": \"Z6091\"\n\t\t\t},\n\t\t\t\"Z6091K1\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z6\"\n\t\t\t\t},\n\t\t\t\t\"Z6K1\": QID\n\t\t\t}\n\t\t}\n\t\treturn enumInstance;\n\t}\n\t\n\t// Construct an instance of Z13518/Natural number\n\t// Copied from Z13519 (changing just the function and argument names)\n\tfunction toNaturalNumber( jsNumber ) {\n\t\treturn {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": \"Z13518\"\n\n\t\t\t},\n\t\t\t\"Z13518K1\": {\n\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\"Z6K1\": jsNumber.toString()\n\t\t\t}\n\t\t};\n\t}\n\n\t// Construct an instance of Z16683/Integer\n\t// Copied from Z16687 (changing just the function and argument names)\n\tfunction toInteger( jsInteger ) {\n\t\tlet sign = 0;\n\t\tif (jsInteger \u003E 0n) sign = 1;\n\t\tif (jsInteger \u003C 0n) sign = -1;\n\n\t\tlet signzid = '';\n\t\tswitch (sign) {\n\t\t\tcase -1: signzid = 'Z16662'; break;\n\t\t\tcase 0: signzid = 'Z16661'; break;\n\t\t\tcase 1: signzid = 'Z16660'; break;\n\t\t}\n\n\t\tlet value = jsInteger;\n\t\tif (value \u003C 0n) value = -1n * value;\n\n\t\treturn {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": \"Z16683\"\n\n\t\t\t},\n\t\t\t\"Z16683K1\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z16659\"\n\t\t\t\t},\n\t\t\t\t\"Z16659K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": signzid\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"Z16683K2\": {\n\t\t\t\t\"Z1K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\t\"Z9K1\": \"Z13518\"\n\t\t\t\t},\n\t\t\t\t\"Z13518K1\": {\n\t\t\t\t\t\"Z1K1\": \"Z6\",\n\t\t\t\t\t\"Z6K1\": value.toString()\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\treturn {\n\t\t\"Z1K1\": {\n\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\"Z9K1\": \"Z6064\"\n\t\t},\n\t\t\"Z6064K1\": {\n\t\t\t\"Z1K1\": {\n\t\t\t\t\"Z1K1\": \"Z9\",\n\t\t\t\t\"Z9K1\": \"Z6061\"\n\t\t\t},\n\t\t\t\"Z6061K1\": toGregorianCalendarDate( Z28687K1.K1.K1 ),\n\t\t\t\"Z6061K2\": toTimeOfDay( Z28687K1.K1.K2 )\n\t\t},\n\t\t\"Z6064K2\": toLightweightEnumItemInstance( 'Z6062', Z28687K1.K2),\n\t\t\"Z6064K3\": toNaturalNumber( Z28687K1.K3 ),\n\t\t\"Z6064K4\": toNaturalNumber( Z28687K1.K4 ),\n\t\t\"Z6064K5\": toInteger( Z28687K1.K5 ),\n\t\t\"Z6064K6\": toLightweightEnumItemInstance( 'Z6063', Z28687K1.K6 )\n\t};\n}"
        },
        "Z64K4": "Object"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Convert to Wikidata time, JavaScript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}