Skip to content

Commit

Permalink
Fix date not being properly displayed due to Carbon3 change (#2685)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored Nov 14, 2024
1 parent 860e807 commit 8c12646
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Metadata/Json/JsonRequestFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public function get_age_text(): string
}
try {
$text = match (0) {
now()->diffInMinutes($age) => now()->diffInSeconds($age) . ' seconds',
now()->diffInHours($age) => now()->diffInMinutes($age) . ' minutes',
now()->diffInDays($age) => now()->diffInHours($age) . ' hours',
now()->diffInWeeks($age) => now()->diffInDays($age) . ' days',
now()->diffInMonths($age) => now()->diffInWeeks($age) . ' weeks',
now()->diffInYears($age) => now()->diffInMonths($age) . ' months',
(int) now()->diffInMinutes($age) => (int) -now()->diffInSeconds($age) . ' seconds',
(int) now()->diffInHours($age) => (int) -now()->diffInMinutes($age) . ' minutes',
(int) now()->diffInDays($age) => (int) -now()->diffInHours($age) . ' hours',
(int) now()->diffInWeeks($age) => (int) -now()->diffInDays($age) . ' days',
(int) now()->diffInMonths($age) => (int) -now()->diffInWeeks($age) . ' weeks',
(int) now()->diffInYears($age) => (int) -now()->diffInMonths($age) . ' months',
default => now()->diffInYears($age) . ' years',
};

Expand Down

0 comments on commit 8c12646

Please sign in to comment.