mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			45 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
		
		
			
		
	
	
			45 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
| 
								 
											8 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								NS_ASSUME_NONNULL_BEGIN
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								@interface DateUtil : NSObject
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								+ (NSDateFormatter *)dateFormatter;
							 | 
						||
| 
								 | 
							
								+ (NSDateFormatter *)timeFormatter;
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (NSDateFormatter *)monthAndDayFormatter;
							 | 
						||
| 
								 | 
							
								+ (NSDateFormatter *)shortDayOfWeekFormatter;
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (BOOL)dateIsOlderThanToday:(NSDate *)date;
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								+ (BOOL)dateIsOlderThanOneWeek:(NSDate *)date;
							 | 
						||
| 
								 
											11 years ago
										 
									 | 
							
								+ (BOOL)dateIsToday:(NSDate *)date;
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (BOOL)dateIsThisYear:(NSDate *)date;
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (BOOL)dateIsYesterday:(NSDate *)date;
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (NSString *)formatPastTimestampRelativeToNow:(uint64_t)pastTimestamp
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								    NS_SWIFT_NAME(formatPastTimestampRelativeToNow(_:));
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (NSString *)formatTimestampShort:(uint64_t)timestamp;
							 | 
						||
| 
								 | 
							
								+ (NSString *)formatDateShort:(NSDate *)date;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (NSString *)formatTimestampAsTime:(uint64_t)timestamp;
							 | 
						||
| 
								 | 
							
								+ (NSString *)formatDateAsTime:(NSDate *)date;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (NSString *)formatMessageTimestamp:(uint64_t)timestamp;
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (BOOL)isTimestampFromLastHour:(uint64_t)timestamp;
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								// These two "exemplary" values can be used by views to measure
							 | 
						||
| 
								 | 
							
								// the likely size for recent values formatted using isTimestampFromLastHour:.
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (NSString *)exemplaryNowTimeFormat;
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (NSString *)exemplaryMinutesTimeFormat;
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (NSString *)formatDateForConversationDateBreaks:(NSDate *)date;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											7 years ago
										 
									 | 
							
								+ (BOOL)isSameDayWithTimestamp:(uint64_t)timestamp1 timestamp:(uint64_t)timestamp2;
							 | 
						||
| 
								 | 
							
								+ (BOOL)isSameDayWithDate:(NSDate *)date1 date:(NSDate *)date2;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								@end
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								NS_ASSUME_NONNULL_END
							 |