Fix showing comments older than one week in the "latest comments" view
This commit is contained in:
parent
c1e3f69a96
commit
7b4f3a4e8d
|
@ -1,3 +1,9 @@
|
|||
# v1.2.x
|
||||
## 09/16/2016
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fix [#37](https://github.com/getgrav/grav-plugin-comments/issues/37) showing comments older than one week in the "latest comments" view
|
||||
|
||||
# v1.2.4
|
||||
## 09/15/2016
|
||||
|
||||
|
|
|
@ -312,11 +312,6 @@ class CommentsPlugin extends Plugin
|
|||
|
||||
for ($i = 0; $i < count($data['comments']); $i++) {
|
||||
$commentTimestamp = \DateTime::createFromFormat('D, d M Y H:i:s', $data['comments'][$i]['date'])->getTimestamp();
|
||||
$sevenDaysAgo = time() - (7 * 24 * 60 * 60);
|
||||
|
||||
if ($commentTimestamp < $sevenDaysAgo) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data['comments'][$i]['pageTitle'] = $data['title'];
|
||||
$data['comments'][$i]['filePath'] = $file->filePath;
|
||||
|
|
Loading…
Reference in New Issue