Skip to content

Instantly share code, notes, and snippets.

@mdestafadilah
Created July 23, 2025 03:21
Show Gist options
  • Select an option

  • Save mdestafadilah/c56b2ed91de4d786de7fd81b185646ca to your computer and use it in GitHub Desktop.

Select an option

Save mdestafadilah/c56b2ed91de4d786de7fd81b185646ca to your computer and use it in GitHub Desktop.
PRAYER.JS EXAMPLE
<script>
function updateClock() {
const clockElement = document.getElementById("jam");
const now = new Date();
const hours = now.getHours().toString().padStart(2, "0");
const minutes = now.getMinutes().toString().padStart(2, "0");
const seconds = now.getSeconds().toString().padStart(2, "0");
clockElement.textContent = `${hours}:${minutes} WIB`;
}
setInterval(updateClock, 1000);
updateClock();
</script>
<script src="https://rsummi.co.id/assets/js/PrayTimes.js"></script>
<script type="text/javascript">
var date = new Date();
prayTimes.adjust({
"fajr": 20,
"isha": 18
});
var times = prayTimes.getTimes(date, [-6.608408787676413, 106.79465505318183], +7);
$('#jadwal-shubuh').html(times['fajr'])
$('#jadwal-dzuhur').html(times['dhuhr'])
$('#jadwal-ashar').html(times['asr'])
$('#jadwal-maghrib').html(times['maghrib'])
$('#jadwal-isya').html(times['isha'])
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment