Latest 0.1.2
Homepage https://github.com/Jonzzs/GZZCalendarTool
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

GZZCalendarTool

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

GZZCalendarTool is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'GZZCalendarTool'

Method

/**
 获取节假日

 @param date 日期
 @return 节假日
 */
+ (nullable NSString *)holidayFromDate:(NSDate *)date;

/**
 获取阴历日期

 @param date 日期
 @return 阴历
 */
+ (nullable NSString *)lunarFromDate:(NSDate *)date;

/**
 获取二十四节气

 @param date 日期
 @return 节气
 */
+ (nullable NSString *)solarTermFromDate:(NSDate *)date;

Usage

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd";

NSLog(@"%@", [GZZCalendarTool lunarFromDate:[formatter dateFromString:@"2018-10-09"]]); // 九月
NSLog(@"%@", [GZZCalendarTool lunarFromDate:[formatter dateFromString:@"2018-11-01"]]); // 廿四

NSLog(@"%@", [GZZCalendarTool solarTermFromDate:[formatter dateFromString:@"2018-10-23"]]); // 霜降
NSLog(@"%@", [GZZCalendarTool solarTermFromDate:[formatter dateFromString:@"2018-11-07"]]); // 立冬

NSLog(@"%@", [GZZCalendarTool holidayFromDate:[formatter dateFromString:@"2018-05-13"]]); // 母亲节
NSLog(@"%@", [GZZCalendarTool holidayFromDate:[formatter dateFromString:@"2018-06-17"]]); // 父亲节
NSLog(@"%@", [GZZCalendarTool holidayFromDate:[formatter dateFromString:@"2018-11-29"]]); // 感恩节
NSLog(@"%@", [GZZCalendarTool holidayFromDate:[formatter dateFromString:@"2018-10-01"]]); // 国庆节

Author

Jonzzs, [email protected]

License

GZZCalendarTool is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "GZZCalendarTool",
    "version": "0.1.2",
    "summary": "u83b7u53d6u65e5u5386u7684u8282u65e5u3001u9634u5386u3001u4e8cu5341u56dbu8282u6c14",
    "homepage": "https://github.com/Jonzzs/GZZCalendarTool",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jonzzs": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Jonzzs/GZZCalendarTool.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "GZZCalendarTool/**/*"
}

Pin It on Pinterest

Share This