MediaWiki: Tweeki.js: Difference between revisions
From Ensiklopedia
(Created page with "→Any JavaScript here will be loaded for users using the Tweeki skin: n = new Date(); y = n.getFullYear(); m = n.getMonth() + 1; d = n.getDate(); document.getElementById("date").innerHTML = m + "/" + d + "/" + y;") |
No edit summary Tag: Manual revert |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for users using the Tweeki skin */ | /* 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; |
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;