|
|
|
|
|
|
|
|
if((date != nil) && (format == 1)){ |
|
|
if((date != nil) && (format == 1)){ |
|
|
NCNotificationDateLabel *dateLabel = MSHookIvar<NCNotificationDateLabel *>(self, "_dateLabel"); |
|
|
NCNotificationDateLabel *dateLabel = MSHookIvar<NCNotificationDateLabel *>(self, "_dateLabel"); |
|
|
int timeSinceNow = (int)[date timeIntervalSinceNow]; |
|
|
int timeSinceNow = (int)[date timeIntervalSinceNow]; |
|
|
timeSinceNow = timeSinceNow*-1; |
|
|
|
|
|
|
|
|
bool isFuture = false; |
|
|
|
|
|
if (timeSinceNow > 0){ |
|
|
|
|
|
isFuture = true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
timeSinceNow = timeSinceNow*-1; |
|
|
|
|
|
} |
|
|
bool addMinutes = [[prefs objectForKey:@"addMinutes"] boolValue]; |
|
|
bool addMinutes = [[prefs objectForKey:@"addMinutes"] boolValue]; |
|
|
bool addToCurrent = [[prefs objectForKey:@"addToCurrent"] boolValue]; |
|
|
bool addToCurrent = [[prefs objectForKey:@"addToCurrent"] boolValue]; |
|
|
int hours = timeSinceNow / 3600; |
|
|
int hours = timeSinceNow / 3600; |
|
|
|
|
|
|
|
|
if(hours == 0){ |
|
|
if(hours == 0){ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %im", minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih", hours]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
|
|
|
} |
|
|
} else{ |
|
|
} else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih %im", hours, minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih %im ago", hours, minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih %im ago", hours, minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}else if(addToCurrent){ |
|
|
}else if(addToCurrent){ |
|
|
if(hours == 0){ |
|
|
if(hours == 0){ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %im", minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih", hours]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if((timeSinceNow/60) >= affectTime){ |
|
|
if((timeSinceNow/60) >= affectTime){ |
|
|
|
|
|
|
|
|
if((date != nil) && (format == 1)){ |
|
|
if((date != nil) && (format == 1)){ |
|
|
BSUIRelativeDateLabel *dateLabel = MSHookIvar<BSUIRelativeDateLabel *>(self, "_dateLabel"); |
|
|
BSUIRelativeDateLabel *dateLabel = MSHookIvar<BSUIRelativeDateLabel *>(self, "_dateLabel"); |
|
|
int timeSinceNow = (int)[date timeIntervalSinceNow]; |
|
|
int timeSinceNow = (int)[date timeIntervalSinceNow]; |
|
|
timeSinceNow = timeSinceNow*-1; |
|
|
|
|
|
|
|
|
bool isFuture = false; |
|
|
|
|
|
if (timeSinceNow > 0){ |
|
|
|
|
|
isFuture = true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
timeSinceNow = timeSinceNow*-1; |
|
|
|
|
|
} |
|
|
bool addMinutes = [[prefs objectForKey:@"addMinutes"] boolValue]; |
|
|
bool addMinutes = [[prefs objectForKey:@"addMinutes"] boolValue]; |
|
|
bool addToCurrent = [[prefs objectForKey:@"addToCurrent"] boolValue]; |
|
|
bool addToCurrent = [[prefs objectForKey:@"addToCurrent"] boolValue]; |
|
|
int hours = timeSinceNow / 3600; |
|
|
int hours = timeSinceNow / 3600; |
|
|
|
|
|
|
|
|
if(hours == 0){ |
|
|
if(hours == 0){ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %im", minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih", hours]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
|
|
|
} |
|
|
} else{ |
|
|
} else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih %im", hours, minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih %im ago", hours, minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih %im ago", hours, minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}else if(addToCurrent){ |
|
|
}else if(addToCurrent){ |
|
|
if(hours == 0){ |
|
|
if(hours == 0){ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %im", minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih", hours]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if((timeSinceNow/60) >= affectTime){ |
|
|
if((timeSinceNow/60) >= affectTime){ |
|
|
|
|
|
|
|
|
if((date != nil) && (format == 1)){ |
|
|
if((date != nil) && (format == 1)){ |
|
|
BSUIRelativeDateLabel *dateLabel = MSHookIvar<BSUIRelativeDateLabel *>(self, "_dateLabel"); |
|
|
BSUIRelativeDateLabel *dateLabel = MSHookIvar<BSUIRelativeDateLabel *>(self, "_dateLabel"); |
|
|
int timeSinceNow = (int)[date timeIntervalSinceNow]; |
|
|
int timeSinceNow = (int)[date timeIntervalSinceNow]; |
|
|
timeSinceNow = timeSinceNow*-1; |
|
|
|
|
|
|
|
|
bool isFuture = false; |
|
|
|
|
|
if (timeSinceNow > 0){ |
|
|
|
|
|
isFuture = true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
timeSinceNow = timeSinceNow*-1; |
|
|
|
|
|
} |
|
|
bool addMinutes = [[prefs objectForKey:@"addMinutes"] boolValue]; |
|
|
bool addMinutes = [[prefs objectForKey:@"addMinutes"] boolValue]; |
|
|
bool addToCurrent = [[prefs objectForKey:@"addToCurrent"] boolValue]; |
|
|
bool addToCurrent = [[prefs objectForKey:@"addToCurrent"] boolValue]; |
|
|
int hours = timeSinceNow / 3600; |
|
|
int hours = timeSinceNow / 3600; |
|
|
|
|
|
|
|
|
if(hours == 0){ |
|
|
if(hours == 0){ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %im", minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih", hours]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
|
|
|
} |
|
|
} else{ |
|
|
} else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih %im", hours, minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih %im ago", hours, minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih %im ago", hours, minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}else if(addToCurrent){ |
|
|
}else if(addToCurrent){ |
|
|
if(hours == 0){ |
|
|
if(hours == 0){ |
|
|
if(minutes == 0){ |
|
|
if(minutes == 0){ |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %im", minutes]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%im ago", minutes]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(isFuture){ |
|
|
|
|
|
dateLabel.text = [NSString stringWithFormat:@"in %ih", hours]; |
|
|
|
|
|
}else{ |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
dateLabel.text = [NSString stringWithFormat:@"%ih ago", hours]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if((timeSinceNow/60) >= affectTime){ |
|
|
if((timeSinceNow/60) >= affectTime){ |