02-24-2025, 02:15 PM
(This post was last modified: 02-24-2025, 02:41 PM by stevantosic.)
Hi,
I have been testing the whole system on my localhost network and found a "suspicious" lines of code in the index.html. In details:
updatePlayer(element) {
const now = new Date();
const then = new Date(element.lastActive);
const inactiveTime = (now - then) / 1000;
....
if (inactiveTime < 60) { player ... }
1. const now = new Date();
is CET time for me.
2. const then = new Date(element.lastActive);
is London Time which comes from Sqlite DB (also on my PC).
Hence, the value:
const inactiveTime = (now - then) / 1000;
is around 3600 (one hour). It means that player ... code is unreachable.
I tried an adhoc solution just for testing purposes which works well:
updatePlayer(element) {
const nowLocal = new Date();
const utcTime = nowLocal.getTime() + (nowLocal.getTimezoneOffset() * 60000);
const londonTime = new Date(utcTime);
const now = londonTime;
const then = new Date(element.lastActive);
...
Also, Tag option is chosen in settings.html.
I have been testing the whole system on my localhost network and found a "suspicious" lines of code in the index.html. In details:
updatePlayer(element) {
const now = new Date();
const then = new Date(element.lastActive);
const inactiveTime = (now - then) / 1000;
....
if (inactiveTime < 60) { player ... }
1. const now = new Date();
is CET time for me.
2. const then = new Date(element.lastActive);
is London Time which comes from Sqlite DB (also on my PC).
Hence, the value:
const inactiveTime = (now - then) / 1000;
is around 3600 (one hour). It means that player ... code is unreachable.
I tried an adhoc solution just for testing purposes which works well:
updatePlayer(element) {
const nowLocal = new Date();
const utcTime = nowLocal.getTime() + (nowLocal.getTimezoneOffset() * 60000);
const londonTime = new Date(utcTime);
const now = londonTime;
const then = new Date(element.lastActive);
...
Also, Tag option is chosen in settings.html.