mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Remove all references to reminders.
This commit is contained in:
@@ -55,35 +55,6 @@ class FireflyValidator extends Validator
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function validatePiggyBankReminder()
|
||||
{
|
||||
$array = $this->data;
|
||||
// no reminder? dont care.
|
||||
if (!isset($array['remind_me'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// get or set start date & target date:
|
||||
$startDate = isset($array['startdate']) ? new Carbon($array['startdate']) : new Carbon;
|
||||
$targetDate = isset($array['targetdate']) && strlen($array['targetdate']) > 0 ? new Carbon($array['targetdate']) : null;
|
||||
|
||||
// target date is null? reminder period is always good.
|
||||
if ($array['remind_me'] == '1' && is_null($targetDate)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$nextReminder = Navigation::addPeriod($startDate, $array['reminder'], 0);
|
||||
// reminder is beyond target?
|
||||
if ($nextReminder > $targetDate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
|
Reference in New Issue
Block a user