mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 10:47:00 +00:00 
			
		
		
		
	Final fix for #170. Now to make a new release!
This commit is contained in:
		| @@ -232,7 +232,7 @@ class Navigation | ||||
|             return $date; | ||||
|         } | ||||
|         if ($repeatFreq === 'custom') { | ||||
|             return $theDate; // the date is already at the start. | ||||
|             return $date; // the date is already at the start. | ||||
|         } | ||||
|  | ||||
|  | ||||
| @@ -283,6 +283,18 @@ class Navigation | ||||
|  | ||||
|             return $date; | ||||
|         } | ||||
|         // a custom range requires the session start | ||||
|         // and session end to calculate the difference in days. | ||||
|         // this is then subtracted from $theDate (* $subtract). | ||||
|         if($repeatFreq === 'custom') { | ||||
|             /** @var Carbon $tStart */ | ||||
|             $tStart = session('start', Carbon::now()->startOfMonth()); | ||||
|             /** @var Carbon $tEnd */ | ||||
|             $tEnd       = session('end', Carbon::now()->endOfMonth()); | ||||
|             $diffInDays = $tStart->diffInDays($tEnd); | ||||
|             $date->subDays($diffInDays * $subtract); | ||||
|             return $date; | ||||
|         } | ||||
|  | ||||
|         throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq . '"'); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user