session-ios/Signal/src/util/DateUtil.h

29 lines
821 B
C
Raw Normal View History

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;
+ (NSDateFormatter *)monthAndDayFormatter;
+ (NSDateFormatter *)shortDayOfWeekFormatter;
2018-04-10 20:53:40 +02:00
+ (BOOL)dateIsOlderThanToday:(NSDate *)date;
2014-05-06 19:41:08 +02:00
+ (BOOL)dateIsOlderThanOneWeek:(NSDate *)date;
+ (BOOL)dateIsToday:(NSDate *)date;
+ (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:));
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