From 5dbbc7aee230edd01246627a4d8ce28da2bd7e82 Mon Sep 17 00:00:00 2001 From: WenchaoD Date: Mon, 19 Sep 2016 11:28:03 +0800 Subject: [PATCH] Update README.md --- FSCalendar/FSCalendar+IBExtension.h | 2 +- FSCalendar/FSCalendar.h | 3 --- README.md | 12 ++++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/FSCalendar/FSCalendar+IBExtension.h b/FSCalendar/FSCalendar+IBExtension.h index 6606368..ba68280 100644 --- a/FSCalendar/FSCalendar+IBExtension.h +++ b/FSCalendar/FSCalendar+IBExtension.h @@ -6,7 +6,7 @@ // Copyright © 2016 Wenchao Ding. All rights reserved. // // 注意: 这些方法仅仅为了在IB中使用,不建议直接调用。这些方法在calendar.appearance中使用。如: calendar.appearance.eventDefaultColor -// Warning: For IB usage only. Directly calling these methods is NOT RECOMMENDED. Use calendar.appearance to call these methods instead +// Warning: For IB usage only. Directly calling these methods is NOT RECOMMENDED. Use calendar.appearance instead. #import "FSCalendar.h" diff --git a/FSCalendar/FSCalendar.h b/FSCalendar/FSCalendar.h index 9ea1ecd..4809c8e 100644 --- a/FSCalendar/FSCalendar.h +++ b/FSCalendar/FSCalendar.h @@ -10,13 +10,10 @@ // // FSCalendar is a superior awesome calendar control with high performance, high customizablility and very simple usage. // -// @warning All NSDate instances used in the calendar should be managed by the DateTools category. See FSCalendar+DateTools. -// // @see FSCalendarDataSource // @see FSCalendarDelegate // @see FSCalendarDelegateAppearance // @see FSCalendarAppearance -// @see FSCalendar+DateTools // #import diff --git a/README.md b/README.md index 158eb6f..20732ad 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,18 @@ NSLog(@"Date is %@", string); ```objc self.gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; +``` +* Get component of NSDate + +```objc +NSInteger era = [self.gregorian component:NSCalendarUnitEra fromDate:date]; +NSInteger year = [self.gregorian component:NSCalendarUnitYear fromDate:date]; +NSInteger month = [self.gregorian component:NSCalendarUnitMonth fromDate:date]; +NSInteger day = [self.gregorian component:NSCalendarUnitDay fromDate:date]; +NSInteger hour = [self.gregorian component:NSCalendarUnitHour fromDate:date]; +NSInteger minute = [self.gregorian component:NSCalendarUnitMinute fromDate:date]; +... + ``` * Get next **month**