From cc713ad8e86d88f917e722228bf6b7dfdc69b75a Mon Sep 17 00:00:00 2001 From: freek Date: Thu, 2 Mar 2017 10:56:25 +0100 Subject: [PATCH] fix for wrong value in in list commands --- CHANGELOG.md | 4 ++++ src/Models/Presenters/CheckPresenter.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1610251..d81b7cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-server-monitor` will be documented in this file +## 1.0.1 - 2017-03-02 + +- fix for wrong value in `Next run` in list commands + ## 1.0.0 - 2017-03-02 - initial release diff --git a/src/Models/Presenters/CheckPresenter.php b/src/Models/Presenters/CheckPresenter.php index 9a260c4..2f91c0a 100644 --- a/src/Models/Presenters/CheckPresenter.php +++ b/src/Models/Presenters/CheckPresenter.php @@ -53,6 +53,10 @@ public function getNextRunDiffAttribute(): string return 'As soon as possible'; } - return Carbon::now()->addMinutes($this->next_run_in_minutes)->diffForHumans(); + if (! $this->last_ran_at) { + return 'As soon as possible'; + } + + return Carbon::now()->addMinutes($this->last_ran_at)->diffForHumans(); } }