This commit is contained in:
James Cole
2020-09-06 07:27:36 +02:00
parent af58c30249
commit 9d35048fb9

View File

@@ -180,8 +180,9 @@ class TagController extends Controller
public function index(TagRepositoryInterface $repository) public function index(TagRepositoryInterface $repository)
{ {
// start with oldest tag // start with oldest tag
$oldestTagDate = null === $repository->oldestTag() ? clone session('first') : $repository->oldestTag()->date; $first = session('first', today()) ?? today();
$newestTagDate = null === $repository->newestTag() ? new Carbon : $repository->newestTag()->date; $oldestTagDate = null === $repository->oldestTag() ? clone $first : $repository->oldestTag()->date;
$newestTagDate = null === $repository->newestTag() ? today() : $repository->newestTag()->date;
$oldestTagDate->startOfYear(); $oldestTagDate->startOfYear();
$newestTagDate->endOfYear(); $newestTagDate->endOfYear();
$tags = []; $tags = [];