This commit is contained in:
James Cole
2018-03-25 07:59:06 +02:00
parent f07dc7bd81
commit 0b8654d865

View File

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