From 37ea3424225b1d172a5491067880a3b83057a0c3 Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Wed, 17 May 2023 09:07:49 +0700 Subject: [PATCH] fixing date diff absolute --- app/Models/Document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Document.php b/app/Models/Document.php index aeee71e..91b5a27 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -79,7 +79,7 @@ class Document extends Model return "hari ini jatuh tempo"; } - $diffMonth = now()->diffInMonths($this->due_date, true); + $diffMonth = now()->diffInMonths($this->due_date, false); if ($maxMonthDiff >= $diffMonth && $diffMonth > 0) { return $diffMonth . " bulan mendekati jatuh tempo"; @@ -103,7 +103,7 @@ class Document extends Model get: function () { $maxMonthDiff = 3; - $diffMonth = now()->diffInMonths($this->due_date, true); + $diffMonth = now()->diffInMonths($this->due_date, false); if ($maxMonthDiff >= $diffMonth && $diffMonth > 0) { return [