fixing date diff absolute

dev
Aji Kamaludin 1 year ago
parent cca6ff41fc
commit 37ea342422
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -79,7 +79,7 @@ class Document extends Model
return "hari ini jatuh tempo"; return "hari ini jatuh tempo";
} }
$diffMonth = now()->diffInMonths($this->due_date, true); $diffMonth = now()->diffInMonths($this->due_date, false);
if ($maxMonthDiff >= $diffMonth && $diffMonth > 0) { if ($maxMonthDiff >= $diffMonth && $diffMonth > 0) {
return $diffMonth . " bulan mendekati jatuh tempo"; return $diffMonth . " bulan mendekati jatuh tempo";
@ -103,7 +103,7 @@ class Document extends Model
get: function () { get: function () {
$maxMonthDiff = 3; $maxMonthDiff = 3;
$diffMonth = now()->diffInMonths($this->due_date, true); $diffMonth = now()->diffInMonths($this->due_date, false);
if ($maxMonthDiff >= $diffMonth && $diffMonth > 0) { if ($maxMonthDiff >= $diffMonth && $diffMonth > 0) {
return [ return [

Loading…
Cancel
Save