123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //
- // NSDate+RQExtension.h
- // RQCommon
- //
- // Created by 张嵘 on 2018/11/23.
- // Copyright © 2018 张嵘. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "NSDateFormatter+RQExtension.h"
- #define RQ_D_MINUTE 60
- #define RQ_D_HOUR 3600
- #define RQ_D_DAY 86400
- #define RQ_D_WEEK 604800
- #define RQ_D_YEAR 31556926
- @interface NSDate (RQExtension)
- /**
- * 是否为今天
- */
- - (BOOL)rq_isToday;
- /**
- * 是否为昨天
- */
- - (BOOL)rq_isYesterday;
- /**
- * 是否为今年
- */
- - (BOOL)rq_isThisYear;
- /**
- * 是否本周
- */
- - (BOOL) rq_isThisWeek;
- /**
- * 星期几
- */
- - (NSString *)rq_weekDay;
- /**
- * 是否为在相同的周
- */
- - (BOOL) rq_isSameWeekWithAnotherDate: (NSDate *)anotherDate;
- /**
- * 通过一个时间 固定的时间字符串 "2016/8/10 14:43:45" 返回时间
- * @param timestamp 固定的时间字符串 "2016/8/10 14:43:45"
- */
- + (instancetype)rq_dateWithTimestamp:(NSString *)timestamp;
- /**
- * 返回固定的 当前时间 2016-8-10 14:43:45
- */
- + (NSString *)rq_currentTimestamp;
- /**
- * 返回一个只有年月日的时间
- */
- - (NSDate *)rq_dateWithYMD;
- /**
- * 格式化日期描述
- */
- - (NSString *)rq_formattedDateDescription;
- /** 与当前时间的差距 */
- - (NSDateComponents *)rq_deltaWithNow;
- //////////// MVC&MVVM的商品的发布时间的描述 ////////////
- - (NSString *)rq_string_yyyy_MM_dd;
- - (NSString *)rq_string_yyyy_MM_dd:(NSDate *)toDate;
- //////////// MVC&MVVM的商品的发布时间的描述 ////////////
- @end
|