-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPanel Date and Time #531
CPanel Date and Time #531
Conversation
LGTM 👍 |
var time = hour + ":" + min + ":" + sec; | ||
document.getElementById('time').innerHTML = time; | ||
// refresh rate 999 ms | ||
setTimeout('display_time()', 999) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would've preferred no recursive call via timeout and just a setInterval
outside the function. Either way is fine, just saying. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihneadb you are right.
Should I revert this pull request and change to setInterval
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry, just make another one.
On Sat, Sep 6, 2014 at 11:02 PM, Ivascu Gabriel notifications@github.com
wrote:
In wouso/resources/templates/cpanel/index.html:
- <script type="text/javascript">
function display_time() {
var x = new Date()
var hour = x.getHours()
var min = x.getMinutes()
var sec = x.getSeconds()
// add leading zeros
if (hour < 10) {hour = "0" + hour;}
if (min < 10) {min = "0" + min;}
if (sec < 10) {sec = "0" + sec;}
var time = hour + ":" + min + ":" + sec;
document.getElementById('time').innerHTML = time;
// refresh rate 999 ms
setTimeout('display_time()', 999)
@mihneadb https://github.com/mihneadb you are right.
Should I revert this pull request and change to setInterval ?Reply to this email directly or view it on GitHub
https://github.com/rosedu/wouso/pull/531/files#r17211005.
Mihnea Dobrescu-Balaur
Fix #530
Display: