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
|
//
|
||
7 years ago
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||
8 years ago
|
//
|
||
11 years ago
|
|
||
7 years ago
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
11 years ago
|
@interface DateUtil : NSObject
|
||
|
|
||
|
+ (NSDateFormatter *)dateFormatter;
|
||
|
+ (NSDateFormatter *)timeFormatter;
|
||
7 years ago
|
+ (NSDateFormatter *)monthAndDayFormatter;
|
||
|
+ (NSDateFormatter *)shortDayOfWeekFormatter;
|
||
7 years ago
|
|
||
7 years ago
|
+ (BOOL)dateIsOlderThanToday:(NSDate *)date;
|
||
11 years ago
|
+ (BOOL)dateIsOlderThanOneWeek:(NSDate *)date;
|
||
10 years ago
|
+ (BOOL)dateIsToday:(NSDate *)date;
|
||
7 years ago
|
+ (BOOL)dateIsThisYear:(NSDate *)date;
|
||
7 years ago
|
+ (BOOL)dateIsYesterday:(NSDate *)date;
|
||
11 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;
|
||
|
|
||
11 years ago
|
@end
|
||
7 years ago
|
|
||
|
NS_ASSUME_NONNULL_END
|