{"ScriptPreparationCode":"var t1 = \u00272019-12-31T23:59:59Z\u0027\r\nvar t2 = \u00272019-12-31T23:59:59.123456789Z\u0027\r\nvar t3 = \u00272019-12-31T24:00:00.00Z\u0027\r\nvar t4 = \u00272019-12-31T24:00:00.123Z\u0027\r\nvar t5 = \u00272019-11-31T23:59:59Z\u0027\r\nvar t6 = \u00272019-29-02T23:59:59Z\u0027\r\nvar t7 = \u00272020-29-02T23:59:59Z\u0027\r\nvar t8 = \u00272020-00-01T23:59:59Z\u0027\r\nvar t9 = \u00272020-01-00T23:59:59Z\u0027\r\n\r\nfunction checkNaN(str) {\r\n return !Number.isNaN(Date.parse(str))\r\n}\r\n\r\nfunction checkRound(str) {\r\n var date = Date.parse(str);\r\n if (Number.isNaN(date)) return false;\r\n var cmp = new Date(date).toISOString()\r\n var min = Math.min(str.length, cmp.length)\r\n// return str.substring(0, min - 1) === cmp.substring(0, min - 1)\r\n}\r\n\r\nvar reg = /^\\d{4}-(\\d{2})-(\\d{2})T((\\d{2}):[0-5]\\d:[0-5]\\d)(.\\d{1,9})?Z$/\r\nvar fill = \u00270000-00-00T00:00:00.000000000Z\u0027\r\n\r\nfunction checkFixRound(str) {\r\n var len = str.length\r\n var fix = str.substring(0, len - 1) \u002B fill.substring(len - 1, 30)\r\n var date = Date.parse(fix);\r\n if (Number.isNaN(date)) return false;\r\n var cmp = new Date(date).toISOString()\r\n return fix.substring(0, 23) === cmp.substring(0, 23)\r\n}\r\n\r\nfunction checkRegNaN(str) { \r\n var date = Date.parse(str)\r\n if (Number.isNaN(date)) return false\r\n return reg.test(str)\r\n}\r\n\r\nfunction checkReg31(str) {\r\n var match = str.match(reg)\r\n if (!match) return false\r\n var [, month, day, time, hour, millisecond] = match\r\n if (month == \u002700\u0027 || month \u003E \u002712\u0027 || day == \u002700\u0027 || day \u003E \u002731\u0027) return false\r\n\r\n if (time === \u002724:00:00\u0027 \u0026\u0026 (millisecond === undefined || /^\\.0*$/.test(millisecond))) return true\r\n return hour \u003C= \u002723\u0027\r\n}\r\n\r\nvar dpm = [\u0027\u0027, \u002731\u0027, \u002729\u0027, \u002731\u0027, \u002730\u0027, \u002731\u0027, \u002730\u0027, \u002731\u0027, \u002731\u0027, \u002730\u0027, \u002731\u0027, \u002730\u0027, \u002731\u0027]\r\n\r\nfunction checkDays(str) {\r\n var match = str.match(reg)\r\n if (!match) return false\r\n var [, month, day, time, hour, millisecond] = match\r\n if (day === \u002700\u0027 || day \u003E dpm[\u002Bmonth]) return false\r\n\r\n if (time === \u002724:00:00\u0027 \u0026\u0026 (millisecond === undefined || /^\\.0*$/.test(millisecond))) return true\r\n return hour \u003C= \u002723\u0027\r\n}","TestCases":[{"Name":"checkNaN","Code":"checkNaN(t1)\r\ncheckNaN(t2)\r\ncheckNaN(t3)\r\ncheckNaN(t4)\r\ncheckNaN(t5)\r\ncheckNaN(t6)\r\ncheckNaN(t7)\r\ncheckNaN(t8)\r\ncheckNaN(t9)\r\n","IsDeferred":false},{"Name":"checkRound","Code":"checkRound(t1)\r\ncheckRound(t2)\r\ncheckRound(t3)\r\ncheckRound(t4)\r\ncheckRound(t5)\r\ncheckRound(t6)\r\ncheckRound(t7)\r\ncheckRound(t8)\r\ncheckRound(t9)\r\n","IsDeferred":false},{"Name":"checkRegNaN","Code":"checkRegNaN(t1)\r\ncheckRegNaN(t2)\r\ncheckRegNaN(t3)\r\ncheckRegNaN(t4)\r\ncheckRegNaN(t5)\r\ncheckRegNaN(t6)\r\ncheckRegNaN(t7)\r\ncheckRegNaN(t8)\r\ncheckRegNaN(t9)\r\n","IsDeferred":false},{"Name":"checkReg31","Code":"checkReg31(t1)\r\ncheckReg31(t2)\r\ncheckReg31(t3)\r\ncheckReg31(t4)\r\ncheckReg31(t5)\r\ncheckReg31(t6)\r\ncheckReg31(t7)\r\ncheckReg31(t8)\r\ncheckReg31(t9)\r\n","IsDeferred":false},{"Name":"checkDays","Code":"checkDays(t1)\r\ncheckDays(t2)\r\ncheckDays(t3)\r\ncheckDays(t4)\r\ncheckDays(t5)\r\ncheckDays(t6)\r\ncheckDays(t7)\r\ncheckDays(t8)\r\ncheckDays(t9)\r\n","IsDeferred":false},{"Name":"checkFixRound","Code":"checkFixRound(t1)\r\ncheckFixRound(t2)\r\ncheckFixRound(t3)\r\ncheckFixRound(t4)\r\ncheckFixRound(t5)\r\ncheckFixRound(t6)\r\ncheckFixRound(t7)\r\ncheckFixRound(t8)\r\ncheckFixRound(t9)\r\n","IsDeferred":false}]}