Possible bug in Analog Clock App[Fixed]

Posted on
  • Just noticed that there is an issue in Analog Clock app. It is showing in correct time.

    At the time of the post, the time was 14:45 PM but clock face was showing 1:54 PM

    https://www.espruino.com/ide/emulator.ht­ml?codeurl=https://banglejs.com/apps/app­s/aclock/clock-analog.js&upload.

    Attached the reference!!


    1 Attachment

    • alanogIssue.PNG
  • Sat 2020.01.11

    Has this setting been tried before upload?

    WebIDE >> Communications >> Set Current Time

  • There is no issues with system time. The Hand() function for rendering hours is not provided the correct angle.

    hand(360*minuteDate.getHours()/12, -10, 50);
    As Is - > 360*minuteDate.getHours()/12
    Should Be - >minuteDate.getHours() % 12 * 30 + minuteDate.getMinutes() / 2 | 0

    I got the new values from Mixed Clock example! and it is working as expected with new values

  • What is your time zone? That off by one hour might be it.

  • I’m in UK time zone. Anyway I have fixed the problem by adjusting the hand arm angle. See my previous comment.

  • Thanks! That was a really stupid mistake of mine!

    Would you be able/willing to send a GitHub PR to fix it, or shall I do it?

  • Yes, I will send the PR in day or two.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Possible bug in Analog Clock App[Fixed]

Posted by Avatar for Abhigkar @Abhigkar

Actions