{"ScriptPreparationCode":"window.dt1 = new Date();\r\nwindow.dt2 = new Date();\r\ndt2.setHours(dt2.getHours()\u002B1);\r\n\r\nwindow.compareLocal = function compareLocal(v1, v2) {\r\n const d1 = v1.getFullYear() * 1000 \u002B v1.getMonth() * 32 \u002B v1.getDate();\r\n const d2 = v2.getFullYear() * 1000 \u002B v2.getMonth() * 32 \u002B v2.getDate();\r\n\r\n if (d1 \u003E d2) return 1;\r\n if (d1 \u003C d2) return -1;\r\n return 0;\r\n}\r\n\r\nwindow.compareUTC = function compareUTC(v1, v2) {\r\n const d1 = v1.getUTCFullYear() * 1000 \u002B v1.getUTCMonth() * 32 \u002B v1.getUTCDate();\r\n const d2 = v2.getUTCFullYear() * 1000 \u002B v2.getUTCMonth() * 32 \u002B v2.getUTCDate();\r\n \r\n if (d1 \u003E d2) return 1;\r\n if (d1 \u003C d2) return -1;\r\n return 0;\r\n}\r\n\r\nwindow.compareLocal2 = function compareLocal2(v1, v2) {\r\n let d1 = v1.getFullYear();\r\n let d2 = v2.getFullYear();\r\n if (d1 \u003E d2) return 1;\r\n if (d1 \u003C d2) return -1;\r\n\r\n d1 = v1.getMonth();\r\n d2 = v2.getMonth();\r\n if (d1 \u003E d2) return 1;\r\n if (d1 \u003C d2) return -1;\r\n\r\n d1 = v1.getDate();\r\n d2 = v2.getDate();\r\n if (d1 \u003E d2) return 1;\r\n if (d1 \u003C d2) return -1;\r\n\r\n return 0;\r\n}\r\n\r\nfunction compareLocal3(v1, v2) {\r\n const d1 = new Date(v1).setHours(0, 0, 0, 0);\r\n const d2 = new Date(v2).setHours(0, 0, 0, 0);\r\n if (d1 \u003E d2) return 1;\r\n if (d1 \u003C d2) return -1;\r\n\r\n return 0;\r\n}\r\n","TestCases":[{"Name":"compareLocal","Code":"const result = compareLocal(dt1, dt2);","IsDeferred":false},{"Name":"compareUTC","Code":"const result2 = compareUTC(dt1, dt2);","IsDeferred":false},{"Name":"compareLocal2","Code":"const result3 = compareLocal2(dt1, dt2);","IsDeferred":false},{"Name":"compareLocal3","Code":"const result4 = compareLocal3(dt1, dt2);","IsDeferred":false}]}