mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 18:40:12 +00:00
Correct tag date and add warning.
This commit is contained in:
@@ -154,12 +154,18 @@ class TagController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(TagRepositoryInterface $repository)
|
public function index(TagRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
// start with oldest tag
|
// start with the oldest tag
|
||||||
$first = session('first', today()) ?? today();
|
$first = session('first', today()) ?? today();
|
||||||
$oldestTagDate = $repository->oldestTag() instanceof Tag ? $repository->oldestTag()->date : clone $first;
|
$oldestTagDate = $repository->oldestTag() instanceof Tag ? $repository->oldestTag()->date : clone $first;
|
||||||
$newestTagDate = $repository->newestTag() instanceof Tag ? $repository->newestTag()->date : today();
|
$newestTagDate = $repository->newestTag() instanceof Tag ? $repository->newestTag()->date : today();
|
||||||
$oldestTagDate->startOfYear();
|
$oldestTagDate->startOfYear();
|
||||||
$newestTagDate->endOfYear();
|
$newestTagDate->endOfYear();
|
||||||
|
|
||||||
|
if($oldestTagDate->year < 1970) {
|
||||||
|
$oldestTagDate = Carbon::create(1970, 1, 1, 0, 0, 0, config('app.timezone'));
|
||||||
|
request()->session()->flash('error', trans('firefly.bad_date_transaction'));
|
||||||
|
}
|
||||||
|
|
||||||
$tags = [];
|
$tags = [];
|
||||||
$tags['no-date'] = $repository->getTagsInYear(null);
|
$tags['no-date'] = $repository->getTagsInYear(null);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user