Firing of alerts depends on times before now. Transform now to midnight and find the difference. Then, add that difference to all the other times. That removes problems when the last alert time is before midnight and now is after midnight, which makes the calculations much simpler.
Firing of alerts depends on times before now. Transform now to midnight and find the difference. Then, add that difference to all the other times. That removes problems when the last alert time is before midnight and now is after midnight, which makes the calculations much simpler.