From c637093bbee312ab9a23267c89aed84b0f822285 Mon Sep 17 00:00:00 2001 From: Rebornian48 <80138640+Rebornian48@users.noreply.github.com> Date: Sat, 13 Jan 2024 15:24:09 +0700 Subject: [PATCH] Update script.js --- assets/js/script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index 2c22143..8fa8fd2 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -30,7 +30,7 @@ function parseNIK() { jk = parseInt(tgl, 10) / 40; jk = Math.floor(jk); - if (jk == 1) { + if (jk === 1) { jk = "Perempuan"; } else { jk = "Laki-laki"; @@ -49,7 +49,8 @@ function parseNIK() { // Parse the date var date = new Date(thn, parseInt(bln, 10) - 1, tgl % 40); var d1 = new Date("2014-01-28"); - var selisih = Math.floor(Math.abs(d1 - date) / 86400000); + var d = 86400000; + var selisih = Math.floor(Math.abs(d1 - date) / d); var pasar = pasaran[selisih % 5]; // Parse the date for human var idDate = new Intl.DateTimeFormat("id-ID", {