Skip to content

Commit

Permalink
Bug #257, continuation of #213
Browse files Browse the repository at this point in the history
macOS 13 handles All-day events differently from
previous versions. No longer need a hack to handle
All-day events. Now fixed in "Copy" function too.
  • Loading branch information
sfsam committed Dec 5, 2024
1 parent c179e87 commit c5fc3a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Itsycal/AgendaViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ - (void)copyEventToPasteboard:(id)sender
NSDate *endDate = cell.eventInfo.event.isAllDay
? [self.nsCal dateByAddingUnit:NSCalendarUnitDay value:-1 toDate:cell.eventInfo.event.endDate options:0]
: cell.eventInfo.event.endDate;
if (@available(macOS 13.0, *)) {
// macOS 13 changed All-day events' end date from 12 AM of
// day after last day of event to 11:59:59 PM of last day.
endDate = cell.eventInfo.event.endDate;
}
// Interval formatter just prints single date when from == to.
NSString *duration = [intervalFormatter stringFromDate:cell.eventInfo.event.startDate toDate:endDate];
// If the locale is English and we are in 12 hour time,
Expand Down

0 comments on commit c5fc3a3

Please sign in to comment.