You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiondate_interval_days(\DateInterval$interval): int
83
+
{
84
+
if ($interval->days !== false) {
85
+
return$interval->days;
86
+
}
87
+
88
+
// if days is false, we might be dealing with Carbon.
89
+
// we try to get it from format() instead, and cast it to int
90
+
$days = $interval->format('%a');
91
+
if ($days !== '(unknown)' && is_numeric($days)) {
92
+
return (int) $days;
93
+
}
94
+
95
+
thrownew \RuntimeException("Unable to get days from DateInterval. This shouldn't happen. If you are using a custom date library, trying passing a normal \DateTime.");
96
+
}
97
+
74
98
/**
75
99
* Implementation of RRULE as defined by RFC 5545 (iCalendar).
76
100
* Heavily based on python-dateutil/rrule
@@ -847,37 +871,37 @@ public function occursAt($date)
847
871
// count nb of days and divide by 7 to get number of weeks
0 commit comments