mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 03:27:08 +02:00
Allow optional start date in page collections [#3350]
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
# v1.7.15
|
||||
## mm/dd/2021
|
||||
|
||||
1. [](#improved)
|
||||
* Allow optional start date in page collections [#3350](https://github.com/getgrav/grav/pull/3350)
|
||||
1. [](#bugfix)
|
||||
* Fixed twig deprecated TwigFilter messages [#3348](https://github.com/getgrav/grav/issues/3348)
|
||||
* Fixed fatal error with some markdown links [grav-premium-issues#95](https://github.com/getgrav/grav-premium-issues/issues/95)
|
||||
* Fixed markdown media operations not working when using `image:// stream` [#3333](https://github.com/getgrav/grav/issues/3333) [#3349](https://github.com/getgrav/grav/issues/3349)
|
||||
* Fixed markdown media operations not working when using `image://` stream [#3333](https://github.com/getgrav/grav/issues/3333) [#3349](https://github.com/getgrav/grav/issues/3349)
|
||||
|
||||
# v1.7.14
|
||||
## 04/29/2021
|
||||
|
||||
@@ -438,8 +438,8 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa
|
||||
*/
|
||||
public function dateRange($startDate = null, $endDate = null, $field = null)
|
||||
{
|
||||
$start = $startDate ? Utils::date2timestamp($startDate) : false;
|
||||
$end = $endDate ? Utils::date2timestamp($endDate) : false;
|
||||
$start = $startDate ? Utils::date2timestamp($startDate) : null;
|
||||
$end = $endDate ? Utils::date2timestamp($endDate) : null;
|
||||
|
||||
$entries = [];
|
||||
foreach ($this as $key => $object) {
|
||||
|
||||
@@ -331,14 +331,14 @@ class Collection extends Iterator implements PageCollectionInterface
|
||||
*/
|
||||
public function dateRange($startDate = null, $endDate = null, $field = null)
|
||||
{
|
||||
$start = $startDate ? Utils::date2timestamp($startDate) : false;
|
||||
$end = $endDate ? Utils::date2timestamp($endDate) : false;
|
||||
$start = $startDate ? Utils::date2timestamp($startDate) : null;
|
||||
$end = $endDate ? Utils::date2timestamp($endDate) : null;
|
||||
|
||||
$date_range = [];
|
||||
foreach ($this->items as $path => $slug) {
|
||||
$page = $this->pages->get($path);
|
||||
if (!$page) {
|
||||
continue ;
|
||||
continue;
|
||||
}
|
||||
|
||||
$date = $field ? strtotime($page->value($field)) : $page->date();
|
||||
|
||||
Reference in New Issue
Block a user