mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Restore and fix API tests
This commit is contained in:
@@ -464,7 +464,7 @@ class Navigation
|
||||
$displayFormat = (string) trans('config.month_and_day_js', [], $locale);
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
// increment by month (for year)
|
||||
if ($diff >= 1.0001) {
|
||||
if ($diff >= 1.0001 && $diff < 12.001) {
|
||||
$increment = 'addMonth';
|
||||
$displayFormat = (string) trans('config.month_js');
|
||||
}
|
||||
@@ -495,7 +495,7 @@ class Navigation
|
||||
$format = 'Y-m-d';
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
// Log::debug(sprintf('preferredCarbonFormat(%s, %s) = %f', $start->format('Y-m-d'), $end->format('Y-m-d'), $diff));
|
||||
if ($diff >= 1.001) {
|
||||
if ($diff >= 1.001 && $diff < 12.001) {
|
||||
// Log::debug(sprintf('Return Y-m because %s', $diff));
|
||||
$format = 'Y-m';
|
||||
}
|
||||
@@ -566,7 +566,7 @@ class Navigation
|
||||
{
|
||||
$locale = app('steam')->getLocale();
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
if ($diff >= 1.001) {
|
||||
if ($diff >= 1.001 && $diff < 12.001) {
|
||||
return (string) trans('config.month_js', [], $locale);
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ class Navigation
|
||||
public function preferredEndOfPeriod(Carbon $start, Carbon $end): string
|
||||
{
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
if ($diff >= 1.001) {
|
||||
if ($diff >= 1.001 && $diff < 12.001) {
|
||||
return 'endOfMonth';
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ class Navigation
|
||||
public function preferredRangeFormat(Carbon $start, Carbon $end): string
|
||||
{
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
if ($diff >= 1.001) {
|
||||
if ($diff >= 1.001 && $diff < 12.001) {
|
||||
return '1M';
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ class Navigation
|
||||
public function preferredSqlFormat(Carbon $start, Carbon $end): string
|
||||
{
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
if ($diff >= 1.001) {
|
||||
if ($diff >= 1.001 && $diff < 12.001) {
|
||||
return '%Y-%m';
|
||||
}
|
||||
|
||||
|
@@ -66,7 +66,7 @@ trait UserGroupTrait
|
||||
if ($user instanceof User) {
|
||||
$this->user = $user;
|
||||
if (null === $user->userGroup) {
|
||||
throw new FireflyException(sprintf('User #%d has no user group.', $user->id));
|
||||
throw new FireflyException(sprintf('User #%d ("%s") has no user group.', $user->id, $user->email));
|
||||
}
|
||||
$this->userGroup = $user->userGroup;
|
||||
|
||||
|
Reference in New Issue
Block a user