Skip to content

Commit

Permalink
UPDATES: Use new constants for MacOS X 10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Apr 10, 2016
1 parent 7743050 commit ef5e63a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backends/updates/macosx/macosx-updates.mm
Expand Up @@ -33,6 +33,8 @@
#include <Cocoa/Cocoa.h>
#include <Sparkle/Sparkle.h>

#include <AvailabilityMacros.h>

SUUpdater *sparkleUpdater;

/**
Expand Down Expand Up @@ -136,8 +138,13 @@

bool MacOSXUpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) {
NSDate *date = [sparkleUpdater lastUpdateCheckDate];
#ifdef MAC_OS_X_VERSION_10_10
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
NSDateComponents *components = [gregorian components:(NSCalendarUnitDay | NSCalendarUnitWeekday) fromDate:date];
#else
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *components = [gregorian components:(NSDayCalendarUnit | NSWeekdayCalendarUnit) fromDate:date];
#endif

t.tm_wday = [components weekday];
t.tm_year = [components year];
Expand Down

0 comments on commit ef5e63a

Please sign in to comment.