猎豆优选

NSDate+GFCalendar.h 908B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // NSDate+GFCalendar.h
  3. //
  4. // Created by Mercy on 2016/11/9.
  5. // Copyright © 2016年 Mercy. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. @interface NSDate (GFCalendar)
  9. /**
  10. * 获得当前 NSDate 对象对应的日子
  11. */
  12. - (NSInteger)dateDay;
  13. /**
  14. * 获得当前 NSDate 对象对应的月份
  15. */
  16. - (NSInteger)dateMonth;
  17. /**
  18. * 获得当前 NSDate 对象对应的年份
  19. */
  20. - (NSInteger)dateYear;
  21. /**
  22. * 获得当前 NSDate 对象的上个月的某一天(此处定为15号)的 NSDate 对象
  23. */
  24. - (NSDate *)previousMonthDate;
  25. /**
  26. * 获得当前 NSDate 对象的下个月的某一天(此处定为15号)的 NSDate 对象
  27. */
  28. - (NSDate *)nextMonthDate;
  29. /**
  30. * 获得当前 NSDate 对象对应的月份的总天数
  31. */
  32. - (NSInteger)totalDaysInMonth;
  33. /**
  34. * 获得当前 NSDate 对象对应月份当月第一天的所属星期
  35. */
  36. - (NSInteger)firstWeekDayInMonth;
  37. @end