jgzhou
2021-04-01 3ab0da701943cf1b7f233d1d65016eac0827ee23
Lunar/Lunar/ViewController.m
@@ -6,6 +6,7 @@
//
#import "ViewController.h"
#import "Lunar.h"
@interface ViewController ()
@@ -18,6 +19,76 @@
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor redColor];
//    Solar *d = [Solar fromYmdHms:2021 :4 :1 :0 :0 :0];
    Solar *d = [Solar fromDate:[NSDate new]];
    NSLog(@"公历:%@", [d toFullString]);
    Lunar *l = [d getLunar];
    NSLog(@"农历:%@", [l toString]);
    NSLog(@"年:%@年 属%@ %@", [l getYearInGanZhi], [l getYearShengXiao], [l getYearNaYin]);
    NSLog(@"月:%@月 属%@ %@", [l getMonthInGanZhi], [l getMonthShengXiao], [l getMonthNaYin]);
    NSLog(@"日:%@日 属%@ %@", [l getDayInGanZhi], [l getDayShengXiao], [l getDayNaYin]);
    NSLog(@"儒略日:%@", @([d getJulianDay]));
    NSLog(@"月名:%@", [l getSeason]);
    NSLog(@"月相:%@", [l getYueXiang]);
    NSLog(@"物候:%@", [l getWuHou]);
    NSLog(@"六曜:%@", [l getLiuYao]);
    NSLog(@"彭祖百忌:%@ %@", [l getPengZuGan], [l getPengZuZhi]);
    NSArray *arrDayYi = [l getDayYi];
    NSLog(@"每日宜:%@", arrDayYi.count == 0?@"无":[arrDayYi componentsJoinedByString:@" "]);
    NSArray *arrDayJi = [l getDayJi];
    NSLog(@"每日忌:%@", arrDayJi.count == 0?@"无":[arrDayJi componentsJoinedByString:@" "]);
    NSArray *arrDayJiShen = [l getDayJiShen];
    NSLog(@"吉神宜趋:%@", arrDayJiShen.count == 0?@"无":[arrDayJiShen componentsJoinedByString:@" "]);
    NSArray *arrDayXiongSha = [l getDayXiongSha];
    NSLog(@"凶煞宜忌:%@", arrDayXiongSha.count == 0?@"无":[arrDayXiongSha componentsJoinedByString:@" "]);
    NSLog(@"相冲:%@日 冲%@", [l getDayShengXiao], [l getDayChongDesc]);
    NSLog(@"岁煞:%@", [l getDaySha]);
    NSLog(@"星宿:%@(%@)", [l getXiu], [l getXiuLuck]);
    NSLog(@"星宿歌诀:%@", [l getXiuSong]);
    NSLog(@"贵神方位:阳贵神:%@ 阴贵神:%@", [l getDayPositionYangGuiDesc], [l getDayPositionYinGuiDesc]);
    NSLog(@"喜神方位:%@", [l getDayPositionXiDesc]);
    NSLog(@"福神方位:%@", [l getDayPositionFuDesc]);
    NSLog(@"财神方位:%@", [l getDayPositionCaiDesc]);
    NSLog(@"本月胎神:%@", [l getMonthPositionTai]);
    NSLog(@"今日胎神:%@", [l getDayPositionTai]);
    NSLog(@"值星:%@", [l getZhiXing]);
    NSLog(@"十二天神:%@(%@)%@", [l getDayTianShen], [l getDayTianShenType], [l getDayTianShenLuck]);
    NSLog(@"空亡所值:年=%@ 月=%@ 日=%@", [l getYearXunKong], [l getMonthXunKong], [l getDayXunKong]);
    NineStar *dayNineStar = [l getDayNineStar];
    [dayNineStar toFullString];
    NSLog(@"九星:%@%@-%@星(%@)-%@", [dayNineStar getNumber],[dayNineStar getColor], [dayNineStar getNameInTaiYi], [dayNineStar getWuXing], [dayNineStar getTypeInTaiYi]);
    NSLog(@"九星歌诀:%@", [dayNineStar getSongInTaiYi]);
    JieQi * pJQ = [l getPrevJieQi];
    NSLog(@"上一节气:%@ %@", pJQ.name, [pJQ.solar toString]);
    JieQi * nJQ = [l getNextJieQi];
    NSLog(@"下一节气:%@ %@", nJQ.name, [nJQ.solar toString]);
    NSArray *arrFestivals = [d getFestivals];
    NSLog(@"节日:%@", arrFestivals.count == 0?@"无":[arrFestivals componentsJoinedByString:@" "]);
    NSArray *arrOtherFestivals = [d getOtherFestivals];
    NSLog(@"纪念日:%@", arrOtherFestivals.count == 0?@"":[arrOtherFestivals componentsJoinedByString:@" "]);
    ShuJiu *shujiu = [l getShuJiu];
    NSLog(@"数九:%@", shujiu?[shujiu toFullString]:@"");
    Fu *fu = [l getFu];
    NSLog(@"数九:%@", fu?[fu toFullString]:@"");
}