Created
          December 14, 2014 01:09 
        
      - 
      
 - 
        
Save brennanMKE/24a0c119917b97d73ada to your computer and use it in GitHub Desktop.  
Revisions
- 
        
brennanMKE created this gist
Dec 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ - (BOOL)isNowAGoodTimeForADrink { NSDate *now = [NSDate date]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:NSCalendarUnitWeekday|NSCalendarUnitHour fromDate:now]; BOOL isWeekend = components.weekday == 7 || components.weekday == 0; // sat or sun // it is a good time for a drink on weekends after 11am and weekdays after 5pm return (isWeekend && components.hour >= 11) || (!isWeekend && components.hour >= 17); }