2017-09-19 23:45:18 +02:00
|
|
|
//
|
2018-02-13 19:06:08 +01:00
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
2017-09-19 23:45:18 +02:00
|
|
|
//
|
2014-05-06 19:41:08 +02:00
|
|
|
|
2018-02-13 19:06:08 +01:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2014-05-06 19:41:08 +02:00
|
|
|
@interface DateUtil : NSObject
|
|
|
|
|
|
|
|
+ (NSDateFormatter *)dateFormatter;
|
|
|
|
+ (NSDateFormatter *)timeFormatter;
|
2018-04-10 20:24:35 +02:00
|
|
|
+ (NSDateFormatter *)monthAndDayFormatter;
|
|
|
|
+ (NSDateFormatter *)shortDayOfWeekFormatter;
|
2018-02-14 20:06:39 +01:00
|
|
|
|
2018-04-10 20:53:40 +02:00
|
|
|
+ (BOOL)dateIsOlderThanToday:(NSDate *)date;
|
2014-05-06 19:41:08 +02:00
|
|
|
+ (BOOL)dateIsOlderThanOneWeek:(NSDate *)date;
|
2015-03-29 16:51:46 +02:00
|
|
|
+ (BOOL)dateIsToday:(NSDate *)date;
|
2018-04-10 20:24:35 +02:00
|
|
|
+ (BOOL)dateIsThisYear:(NSDate *)date;
|
2018-04-10 20:53:40 +02:00
|
|
|
+ (BOOL)dateIsYesterday:(NSDate *)date;
|
2014-05-06 19:41:08 +02:00
|
|
|
|
2017-09-27 22:38:41 +02:00
|
|
|
+ (NSString *)formatPastTimestampRelativeToNow:(uint64_t)pastTimestamp
|
2018-02-13 19:06:08 +01:00
|
|
|
isRTL:(BOOL)isRTL NS_SWIFT_NAME(formatPastTimestampRelativeToNow(_:isRTL:));
|
2017-09-27 21:19:50 +02:00
|
|
|
|
2018-06-26 16:17:03 +02:00
|
|
|
+ (NSString *)formatTimestampShort:(uint64_t)timestamp;
|
|
|
|
+ (NSString *)formatDateShort:(NSDate *)date;
|
|
|
|
|
2014-05-06 19:41:08 +02:00
|
|
|
@end
|
2018-02-13 19:06:08 +01:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|