diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
commit | 529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch) | |
tree | 8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/widgets/clock/source.php | |
parent | 15e4724761c50b30803df1811a525c85058f70bf (diff) | |
download | electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2 electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip |
Update
Diffstat (limited to 'Neutron-trunk/widgets/clock/source.php')
-rw-r--r-- | Neutron-trunk/widgets/clock/source.php | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/Neutron-trunk/widgets/clock/source.php b/Neutron-trunk/widgets/clock/source.php new file mode 100644 index 0000000..04c3939 --- /dev/null +++ b/Neutron-trunk/widgets/clock/source.php @@ -0,0 +1,96 @@ +<div id="widget-space"> + <div style="text-align: center;"><h3 id="widget-clock-time">00:00:00</h3><span id="widget-clock-date">????? ??? ??????? ????</span></div> +</div> +<script> + +setInterval(() => { + time = new Date() + hours = time.getHours() + minutes = time.getMinutes() + seconds = time.getSeconds() + day = time.getDate() + month = time.getMonth() + 1 + year = time.getFullYear() + dow = time.getDay() + 1 + if (hours < 10) { + hours_str = "0" + hours + } else { + hours_str = hours + } + if (minutes < 10) { + minutes_str = "0" + minutes + } else { + minutes_str = minutes + } + if (seconds < 10) { + seconds_str = "0" + seconds + } else { + seconds_str = seconds + } + if (day == 1) { + day_str = "<?= $lang["widgets"]["clock"]["ordinal"] ?>" + } else { + day_str = day + } + if (dow == 2) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][0] ?>" + } + if (dow == 3) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][1] ?>" + } + if (dow == 4) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][2] ?>" + } + if (dow == 5) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][3] ?>" + } + if (dow == 6) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][4] ?>" + } + if (dow == 7) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][5] ?>" + } + if (dow == 1) { + dow_str = "<?= $lang["widgets"]["clock"]["days"][6] ?>" + } + if (month == 1) { + month_str = "<?= $lang["widgets"]["clock"]["months"][0] ?>" + } + if (month == 2) { + month_str = "<?= $lang["widgets"]["clock"]["months"][1] ?>" + } + if (month == 3) { + month_str = "<?= $lang["widgets"]["clock"]["months"][2] ?>" + } + if (month == 4) { + month_str = "<?= $lang["widgets"]["clock"]["months"][3] ?>" + } + if (month == 5) { + month_str = "<?= $lang["widgets"]["clock"]["months"][4] ?>" + } + if (month == 6) { + month_str = "<?= $lang["widgets"]["clock"]["months"][5] ?>" + } + if (month == 7) { + month_str = "<?= $lang["widgets"]["clock"]["months"][6] ?>" + } + if (month == 8) { + month_str = "<?= $lang["widgets"]["clock"]["months"][7] ?>" + } + if (month == 9) { + month_str = "<?= $lang["widgets"]["clock"]["months"][8] ?>" + } + if (month == 10) { + month_str = "<?= $lang["widgets"]["clock"]["months"][9] ?>" + } + if (month == 11) { + month_str = "<?= $lang["widgets"]["clock"]["months"][10] ?>" + } + if (month == 12) { + month_str = "<?= $lang["widgets"]["clock"]["months"][11] ?>" + } + document.getElementById('widget-clock-time').innerHTML = hours_str + ":" + minutes_str + ":" + seconds_str + document.getElementById('widget-clock-date').innerHTML = dow_str + " " + day_str + " " + month_str + " " + year +}, 100) + +</script>
\ No newline at end of file |