BangleApps: [activityreminder] Suddenly "Uncaught Error: Function "getHours" not found" error
Affected hardware version
Bangle 2
Your firmware version
2v21
The bug
Bug description
Out of nowhere I suddenly get the following error when opening the activity reminder app:
Uncaught Error: Function "getHours" not found!
at line 9 col 18 in activityreminder.app.js
var h = date.getHours();
^
in function "getHoursMins" called from line 29 col 67 in activityreminder.app.js
...vityreminder_data.stepsDate), y+=h);
^
in function "drawInfo" called from line 49 col 14 in activityreminder.app.js
drawInfo();
^
in function "run" called from line 56 col 7 in activityreminder.app.js
run();
^
in function called from line 58 col 4 in activityreminder.app.js
})();
^
Also, I don’t get any inactivity alerts anymore when sitting for too long, so I assume this that has to do with each other.
The weird thing is that this issue started appearing out of nowhere. The last commit in the activityreminder app was done on Feb 23, 2023 and since I first installed the app it worked for many months, then suddenly it stopped. This is why I believe it might be caused/related to another app’s boot or widget code.
Unfortunately, I’m clueless which app could cause this so I’m opening this issue.
Installed apps
antonclk (0.11), widlock (0.08), notify (0.13), quicklaunch (0.15), authentiwatch (0.07), launch (0.20), slevel (0.04), weather (0.26), thermom (0.07), bee (0.03), intervalTimer (0.01), pomoplus (0.06), noteify (0.03), widbatv (0.03), info (0.03), barometer (0.04), torch (0.11), iconlaunch (0.19), sportmode (0.01), scicalc (0.03), qrcode (0.06), qmsched (0.10), alarm (0.46), messagesmusic (0.05), messages (0.62), imgclock (0.11), boot (0.60), widalarm (0.02), messageicons (0.07), hrm (0.12), circlesclock (0.26), dtlaunch (0.25), agenda (0.15), run (0.18), kbmulti (0.08), sched (0.24), 2047pp (0.04), android (0.34), recorder (0.39), icons (0.02), inspire (0.03), stopwatch (0.06), smpltmr (0.09), clock_info (0.08), widmessages (0.06), mylocation (0.11), setting (0.71), clkinfosunrise (0.05), edisonsball (0.04), sleepphasealarm (0.18), messagegui (0.77), health (0.29), sleeplog (0.16), healthscore (0.01), widhr (0.01), widclk (0.08), widbthide (0.01)
About this issue
- Original URL
- State: closed
- Created 3 months ago
- Comments: 17 (12 by maintainers)
I just bumped the version 👌 Available on the development app loader.
Nice find, thank you all
You could do the same that I have done in PR #3277 for another app.
Basically
new Date(typeof data.okDate === 'string' ? data.okDate : data.okDate.ms)
another option would be
new Date(data.okDate.ms ? data.okDate.ms : data.okDate)
I suspect it is the date format {ms:1711107487213.85571289062} in the current firmware. What you could try is deleting the json after updateing the firmware to bleeding edge.
Yes, I’ve noticed it for some time (~ 1-2 months) but at first I just thought I messed up the app settings somehow and I wouldn’t get any alerts because of that until I eventually connected it to the IDE and noticed the error logs.