@@ -22,29 +22,44 @@ public function canSend(MailatorSchedule $schedule, Collection $logs): bool
2222                return  false ;
2323            }
2424
25+             $ diffint ) $ scheduletimestamp_target ->diffInDays (
26+                 now ()->floorSeconds (),
27+                 absolute: true 
28+             );
29+ 
2530            return  $ scheduleisOnce ()
26-                 ? $ schedule -> timestamp_target -> diffInDays ( now ()-> floorSeconds ())  === $ scheduletoDays ()
27-                 : $ schedule -> timestamp_target -> diffInDays ( now ()-> floorSeconds ())  > $ scheduletoDays ();
31+                 ? $ diff $ scheduletoDays ()
32+                 : $ diff $ scheduletoDays ();
2833        }
2934
3035        if  ($ scheduletoHours () > 0 ) {
3136            if  (now ()->floorSeconds ()->lt ($ scheduletimestampTarget ()->addHours ($ scheduletoHours ()))) {
3237                return  false ;
3338            }
3439
40+             $ diffint ) $ scheduletimestamp_target ->diffInHours (
41+                 now ()->floorSeconds (),
42+                 absolute: true 
43+             );
44+ 
3545            //till ends we should have at least toDays days 
3646            return  $ scheduleisOnce ()
37-                 ? $ schedule -> timestamp_target -> diffInHours ( now ()-> floorSeconds ())  === $ scheduletoHours ()
38-                 : $ schedule -> timestamp_target -> diffInHours ( now ()-> floorSeconds ())  > $ scheduletoHours ();
47+                 ? $ diff $ scheduletoHours ()
48+                 : $ diff $ scheduletoHours ();
3949        }
4050
4151        if  (now ()->floorSeconds ()->lte ($ scheduletimestampTarget ()->addMinutes ($ scheduledelay_minutes ))) {
4252            return  false ;
4353        }
4454
55+         $ diffint ) $ scheduletimestamp_target ->diffInHours (
56+             now ()->floorSeconds (),
57+             absolute: true 
58+         );
59+ 
4560        //till ends we should have at least toDays days 
4661        return  $ scheduleisOnce ()
47-             ? $ schedule -> timestamp_target -> diffInHours ( now ()-> floorSeconds ())  === $ scheduledelay_minutes 
48-             : $ schedule -> timestamp_target -> diffInHours ( now ()-> floorSeconds ())  > $ scheduledelay_minutes ;
62+             ? $ diff $ scheduledelay_minutes 
63+             : $ diff $ scheduledelay_minutes ;
4964    }
5065}
0 commit comments