NSDate+HXExtension.h 691 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // NSDate+HXExtension.h
  3. // HXPhotoPickerExample
  4. //
  5. // Created by Silence on 2017/10/14.
  6. // Copyright © 2017年 Silence. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface NSDate (HXExtension)
  10. /**
  11. 是否今天
  12. @return yes or no
  13. */
  14. - (BOOL)hx_isToday;
  15. /**
  16. 是否昨天
  17. @return yes or no
  18. */
  19. - (BOOL)hx_isYesterday;
  20. /**
  21. 是否今年
  22. @return yes or no
  23. */
  24. - (BOOL)hx_isThisYear;
  25. /**
  26. 和今天是否在同一周
  27. @return yes or no
  28. */
  29. - (BOOL)hx_isSameWeek;
  30. - (NSString *)hx_getNowWeekday;
  31. /**
  32. 按指定格式获取当前的时间
  33. @param format 格式
  34. @return 日期字符串
  35. */
  36. - (NSString *)hx_dateStringWithFormat:(NSString *)format;
  37. @end