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
India only has Sunday as their weekend; the other places (GB, US, etc) have two days. Update `Calendar.nextWeekend(startingAfter:direction:)` to handle this case.
153114732
// We only care about the end date to get the interval of the weekend, so we don't care if it falls ahead of the passed in date. Always search forward from here, since we just found the *beginning* of the weekend.
1157
-
guardvar end =nextDate(after: start, matching: weekendEndComponents, matchingPolicy:.nextTime, repeatedTimePolicy:.first, direction:.forward)else{
1158
-
returnnil
1156
+
1157
+
varend:Date
1158
+
if weekend.start == weekend.end {
1159
+
// This locale has a 1-day weekend
1160
+
end = start
1161
+
}else{
1162
+
// We only care about the end date to get the interval of the weekend, so we don't care if it falls ahead of the passed in date. Always search forward from here, since we just found the *beginning* of the weekend.
0 commit comments