MediaWiki: Tweeki.js: Difference between revisions
From Ensiklopedia
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
(One intermediate revision by the same user not shown) | |||
Line 32: | Line 32: | ||
tampilTanggal = hari + ", " + tanggal + " " + bulan + " " + tahun | tampilTanggal = hari + ", " + tanggal + " " + bulan + " " + tahun | ||
document.querySelector("p.date").innerHTML = tampilTanggal; | document.querySelector("p.date").innerHTML = tampilTanggal; | ||
Latest revision as of 16:58, 2 August 2023
/* Any JavaScript here will be loaded for users using the Tweeki skin */ date = new Date(); tahun = date.getFullYear(); bulan = date.getMonth(); tanggal = date.getDate(); hari = date.getDay(); switch(hari) { case 0: hari = "Minggu"; break; case 1: hari = "Senin"; break; case 2: hari = "Selasa"; break; case 3: hari = "Rabu"; break; case 4: hari = "Kamis"; break; case 5: hari = "Jum'at"; break; case 6: hari = "Sabtu"; break; } switch(bulan) { case 0: bulan = "Januari"; break; case 1: bulan = "Februari"; break; case 2: bulan = "Maret"; break; case 3: bulan = "April"; break; case 4: bulan = "Mei"; break; case 5: bulan = "Juni"; break; case 6: bulan = "Juli"; break; case 7: bulan = "Agustus"; break; case 8: bulan = "September"; break; case 9: bulan = "Oktober"; break; case 10: bulan = "November"; break; case 11: bulan = "Desember"; break; } tampilTanggal = hari + ", " + tanggal + " " + bulan + " " + tahun document.querySelector("p.date").innerHTML = tampilTanggal;