allow disabling comment date display using discussiondatedisplay configuration option

This commit is contained in:
El RIDO 2024-05-04 14:38:41 +02:00
parent 5421e8e558
commit 0f9158b37b
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
7 changed files with 31 additions and 14 deletions

View file

@ -196,7 +196,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
this.getCreated = function()
{
return this.meta[this.v === 1 ? 'postdate' : 'created'];
return this.meta[this.v === 1 ? 'postdate' : 'created'] || 0;
}
/**
@ -3484,9 +3484,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
}
// set date
const created = comment.getCreated();
const commentDate = created == 0 ? '' : ' (' + (new Date(created * 1000).toLocaleString()) + ')';
$commentEntry.find('span.commentdate')
.text(' (' + (new Date(comment.getCreated() * 1000).toLocaleString()) + ')')
.attr('title', 'CommentID: ' + comment.id);
.text(commentDate)
.attr('title', 'CommentID: ' + comment.id);
// if an avatar is available, display it
const icon = comment.getIcon();