Skip to content
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

Merged
merged 5 commits into from Sep 6, 2014
Merged

CPanel Date and Time #531

merged 5 commits into from Sep 6, 2014

Conversation

givascu
Copy link
Contributor

@givascu givascu commented Sep 6, 2014

Fix #530

Display:
rsz_sss

@iulianR
Copy link
Member

iulianR commented Sep 6, 2014

LGTM 👍

iulianR added a commit that referenced this pull request Sep 6, 2014
@iulianR iulianR merged commit d62155e into rosedu:master Sep 6, 2014
@givascu givascu deleted the issues branch September 6, 2014 19:36
var time = hour + ":" + min + ":" + sec;
document.getElementById('time').innerHTML = time;
// refresh rate 999 ms
setTimeout('display_time()', 999)
Copy link
Member

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. :)

Copy link
Contributor Author

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 ?

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add date + time to top navigation bar in CPanel
3 participants