Home » Forum » Bug Report and Feature Requests

Forum: Bug Report and Feature Requests

Comments timestamp timezone issue?

Magalis 🚫

I noticed this when reading story with comments enabled.

On the first load of the last chapter of the story, the most recent 10 comments are displayed, and the code has the comments' timestamp generated by script block and a noscript block. However, the subsequent pages of comments (generated by getmore requests) the response has timestamps of comments (presumably) the same(?) as the noscript block, resulting in situations where clicking the second page then the first page comments result in comment timestamp mutated.

Lazeez Jiddan (Webmaster)

@Magalis

this is due to browser security. You can't run a javascript from a page loaded via javascript.

I'll need to completely rework how the system works for this to get fixed.

Replies:   Gauthier
Gauthier 🚫

@Lazeez Jiddan (Webmaster)

(function () {
[].forEach.call(document.querySelectorAll('[data-epoch]'), function(ts) {
try {
var tstamp = new Date(parseInt(ts.dataset.epoch));
if (ts.dataset.format == "date") {
ts.textContent = tstamp.toLocaleDateString();
} else {
ts.textContent = tstamp.toLocaleString();
}
} catch (e) {
Console.log('data-epoch attribute value is not a valid epoch string');
}
});
}());

Replies:   Gauthier
Gauthier 🚫
Updated:

@Gauthier

with html:

< span data-epoch="1493051813000" data-format="date" >2017-04-24< /span >

Back to Top

 

WARNING! ADULT CONTENT...

Storiesonline is for adult entertainment only. By accessing this site you declare that you are of legal age and that you agree with our Terms of Service and Privacy Policy.


Log In