This commit is contained in:
James Cole 2018-03-25 07:59:06 +02:00
parent f07dc7bd81
commit 0b8654d865
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -22,6 +22,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
use Carbon\Carbon;
use FireflyConfig;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@ -120,12 +121,20 @@ class UpdateController extends Controller
if ($check === -1) {
// there is a new FF version!
$string = strval(
trans(
'firefly.update_new_version_alert',
['your_version' => $current, 'new_version' => $first->getTitle(), 'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat)]
)
);
// has it been released for more than three days?
$today = new Carbon;
if ($today->diffInDays($first->getUpdated(), true) > 3) {
$string = strval(
trans(
'firefly.update_new_version_alert',
[
'your_version' => $current,
'new_version' => $first->getTitle(),
'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat),
]
)
);
}
}
if ($check === 0) {
// you are running the current version!