Page MenuHomePhorge

D2365.1774893167.diff
No OneTemporary

Authored By
Unknown
Size
947 B
Referenced Files
None
Subscribers
None

D2365.1774893167.diff

diff --git a/src/app/Http/Controllers/API/V4/WalletsController.php b/src/app/Http/Controllers/API/V4/WalletsController.php
--- a/src/app/Http/Controllers/API/V4/WalletsController.php
+++ b/src/app/Http/Controllers/API/V4/WalletsController.php
@@ -316,9 +316,14 @@
return \trans('app.wallet-notice-today');
}
+ // Once in a while we got e.g. "3 weeks" instead of expected "4 weeks".
+ // It's because $until uses full seconds, but $now is more precise.
+ // We make sure both have the same time set.
+ $now = Carbon::now()->setTimeFrom($until);
+
$params = [
'date' => $until->toDateString(),
- 'days' => Carbon::now()->diffForHumans($until, Carbon::DIFF_ABSOLUTE),
+ 'days' => $now->diffForHumans($until, Carbon::DIFF_ABSOLUTE),
];
return \trans('app.wallet-notice-date', $params);

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 30, 5:52 PM (2 d, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18818151
Default Alt Text
D2365.1774893167.diff (947 B)

Event Timeline