jgzhou
2021-04-01 64ccaebbd809b1f854c2dad91f6a6bb2e32c843f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
//
//  Lunar.h
//  animation
//
//  Created by zhoujigang on 2021/3/16.
//
 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
 
NS_ASSUME_NONNULL_BEGIN
 
@class SolarUtil;
@class LunarUtil;
@class HolidayUtil;
@class DaYun;
@class EightChar;
@class Fu;
@class Holiday;
@class JieQi;
@class LiuNian;
@class LiuYue;
@class Lunar;
@class NineStar;
@class ShuJiu;
@class Solar;
@class SolarHalfYear;
@class SolarMonth;
@class SolarSeason;
@class SolarWeek;
@class SolarYear;
@class XiaoYun;
@class Yun;
 
 
/**
 * 农历日期
 */
@interface Lunar : NSObject
 
//节气表头部追加农历上年末的节气名(节令:大雪),以示区分
@property (nonatomic, strong) NSString *JIE_QI_PREPEND;
 
//节气表尾部追加农历下年初的节气名(气令:冬至),以示区分
@property (nonatomic, strong) NSString *JIE_QI_APPEND;
 
//农历年初节气名(气令:冬至)
@property (nonatomic, strong) NSString *JIE_QI_FIRST;
 
//农历年末节气名(节令:大雪)
@property (nonatomic, strong) NSString *JIE_QI_LAST;
 
//节气表尾部追加阳历下年初的第一个节气名(节令:小寒),以示区分
@property (nonatomic, strong) NSString *JIE_APPEND_SOLAR_FIRST;
 
//节气表尾部追加阳历下年初的第二个节气名(气令:大寒),以示区分
@property (nonatomic, strong) NSString *QI_APPEND_SOLAR_SECOND;
 
// 阳历下年初的第一个节气名(节令:小寒)
@property (nonatomic, strong) NSString *JIE_SOLAR_FIRST;
 
//阳历下年初的第二个节气名(气令:大寒)
@property (nonatomic, strong) NSString *QI_SOLAR_SECOND;
 
//节气表,国标以冬至为首个节气
@property (nonatomic, strong) NSArray *JIE_QI;
 
@property (nonatomic, strong) NSArray *NUT_B;
@property (nonatomic, strong) NSArray *DT_AT;
@property (nonatomic, strong) NSArray *XL0;
@property (nonatomic, strong) NSArray *QI_KB;
@property (nonatomic, strong) NSString *QB;
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//月
@property (nonatomic, assign, readonly) NSInteger month;
 
//日
@property (nonatomic, assign, readonly) NSInteger day;
 
//时
@property (nonatomic, assign, readonly) NSInteger hour;
 
//分
@property (nonatomic, assign, readonly) NSInteger minute;
 
//秒
@property (nonatomic, assign, readonly) NSInteger second;
 
//对应阳历
@property (nonatomic, strong, readonly) Solar *solar;
 
//相对于基准日的偏移天数
@property (nonatomic, assign, readonly) NSInteger dayOffset;
 
//时对应的天干下标,0-9
@property (nonatomic, assign, readonly) NSInteger timeGanIndex;
 
//时对应的地支下标,0-11
@property (nonatomic, assign, readonly) NSInteger timeZhiIndex;
 
//日对应的天干下标,0-9
@property (nonatomic, assign, readonly) NSInteger dayGanIndex;
 
//日对应的天干下标(八字流派1,晚子时日柱算明天),0-9
@property (nonatomic, assign, readonly) NSInteger dayGanIndexExact;
 
//日对应的天干下标(八字流派2,晚子时日柱算当天),0-9
@property (nonatomic, assign, readonly) NSInteger dayGanIndexExact2;
 
//日对应的地支下标,0-11
@property (nonatomic, assign, readonly) NSInteger dayZhiIndex;
 
//日对应的地支下标(八字流派1,晚子时日柱算明天),0-9
@property (nonatomic, assign, readonly) NSInteger dayZhiIndexExact;
 
//日对应的地支下标(八字流派1,晚子时日柱算当天),0-9
@property (nonatomic, assign, readonly) NSInteger dayZhiIndexExact2;
 
//月对应的天干下标(以节交接当天起算),0-9
@property (nonatomic, assign, readonly) NSInteger monthGanIndex;
 
//月对应的地支下标(以节交接当天起算),0-11
@property (nonatomic, assign, readonly) NSInteger monthZhiIndex;
 
//月对应的天干下标(最精确的,供八字用,以节交接时刻起算),0-9
@property (nonatomic, assign, readonly) NSInteger monthGanIndexExact;
 
//月对应的地支下标(最精确的,供八字用,以节交接时刻起算),0-11
@property (nonatomic, assign, readonly) NSInteger monthZhiIndexExact;
 
//年对应的天干下标(国标,以正月初一为起点),0-9
@property (nonatomic, assign, readonly) NSInteger yearGanIndex;
 
//年对应的地支下标(国标,以正月初一为起点),0-11
@property (nonatomic, assign, readonly) NSInteger yearZhiIndex;
 
//年对应的天干下标(月干计算用,以立春为起点),0-9
@property (nonatomic, assign, readonly) NSInteger yearGanIndexByLiChun;
 
//年对应的地支下标(月支计算用,以立春为起点),0-11
@property (nonatomic, assign, readonly) NSInteger yearZhiIndexByLiChun;
 
//年对应的天干下标(最精确的,供八字用,以立春交接时刻为起点),0-9
@property (nonatomic, assign, readonly) NSInteger yearGanIndexExact;
 
//年对应的地支下标(最精确的,供八字用,以立春交接时刻为起点),0-11
@property (nonatomic, assign, readonly) NSInteger yearZhiIndexExact;
 
//星期下标(0-6),0代表周日,1代表周一
@property (nonatomic, assign, readonly) NSInteger weekIndex;
 
//24节气表(对应阳历的准确时刻)
@property (nonatomic, strong, readonly) NSMutableDictionary<NSString *, Solar *> *jieQi;
 
//八字
@property (nonatomic, strong, readonly) EightChar *eightChar;
 
+ (instancetype)share;
 
@end
 
/**
 * 阳历工具,基准日期为1901年1月1日,对应农历1900年十一月十一
 */
@interface SolarUtil : NSObject
 
//阳历基准年
@property (nonatomic, assign) NSInteger BASE_YEAR;
 
//阳历基准月
@property (nonatomic, assign) NSInteger BASE_MONTH;
 
//阳历基准日
@property (nonatomic, assign) NSInteger BASE_DAY;
 
//星期
@property (nonatomic, strong) NSArray *WEEK;
 
//每月天数
@property (nonatomic, strong) NSArray *DAYS_OF_MONTH;
 
//星座
@property (nonatomic, strong) NSArray *XING_ZUO;
 
//日期对应的节日
@property (nonatomic, strong) NSDictionary* FESTIVAL;
 
//几月第几个星期几对应的节日
@property (nonatomic, strong) NSDictionary* WEEK_FESTIVAL;
 
//日期对应的非正式节日
@property (nonatomic, strong) NSDictionary<NSString *, NSArray *>* OTHER_FESTIVAL;
 
+ (instancetype)share;
 
+ (BOOL)isLeapYear:(NSInteger)year;
 
+ (NSInteger)getDaysOfMonth:(NSInteger)year :(NSInteger)month;
 
+ (NSInteger)getWeeksOfMonth:(NSInteger)year :(NSInteger)month :(NSInteger)start;
 
@end
 
/**
 * 农历工具,基准日期为1900年十一月十一,对应阳历1901年1月1日,最远仅支持到2099年
 */
@interface LunarUtil : NSObject
 
@property (nonatomic, assign) NSInteger BASE_YEAR;
@property (nonatomic, assign) NSInteger BASE_MONTH;
@property (nonatomic, assign) NSInteger BASE_DAY;
@property (nonatomic, assign) NSInteger BASE_INDEX;
@property (nonatomic, assign) NSInteger BASE_YEAR_JIU_XING_INDEX;
@property (nonatomic, assign) NSInteger BASE_YEAR_GAN_ZHI_INDEX;
@property (nonatomic, assign) NSInteger BASE_DAY_GAN_ZHI_INDEX;
@property (nonatomic, assign) NSInteger BASE_MONTH_ZHI_INDEX;
@property (nonatomic, assign) NSInteger BASE_WEEK_INDEX;
 
@property (nonatomic, strong) NSArray *LEAP_MONTH_YEAR;
@property (nonatomic, strong) NSArray *LUNAR_MONTH;
@property (nonatomic, strong) NSArray *XUN;
@property (nonatomic, strong) NSArray *XUN_KONG;
@property (nonatomic, strong) NSArray *LIU_YAO;
@property (nonatomic, strong) NSArray *WU_HOU;
@property (nonatomic, strong) NSArray *GAN;
@property (nonatomic, strong) NSArray *POSITION_XI;
@property (nonatomic, strong) NSArray *POSITION_YANG_GUI;
@property (nonatomic, strong) NSArray *POSITION_YIN_GUI;
@property (nonatomic, strong) NSArray *POSITION_FU;
@property (nonatomic, strong) NSArray *POSITION_CAI;
 
@property (nonatomic, strong) NSArray *POSITION_TAI_DAY;
@property (nonatomic, strong) NSArray *POSITION_TAI_MONTH;
@property (nonatomic, strong) NSArray *ZHI;
@property (nonatomic, strong) NSArray *JIA_ZI;
@property (nonatomic, strong) NSArray *ZHI_XING;
@property (nonatomic, strong) NSArray *TIAN_SHEN;
@property (nonatomic, strong) NSArray *YI_JI;
 
@property (nonatomic, strong) NSString *DAY_YI_JI;
@property (nonatomic, strong) NSString *TIME_YI_JI;
 
@property (nonatomic, strong) NSArray *SHEN_SHA;
 
@property (nonatomic, strong) NSString *DAY_SHEN_SHA;
 
@property (nonatomic, strong) NSDictionary *ZHI_TIAN_SHEN_OFFSET;// 月份地支对应天神偏移下标
@property (nonatomic, strong) NSDictionary *TIAN_SHEN_TYPE;// 天神类型:黄道,黑道
@property (nonatomic, strong) NSDictionary *TIAN_SHEN_TYPE_LUCK;// 天神类型吉凶
@property (nonatomic, strong) NSArray *PENG_ZU_GAN;
@property (nonatomic, strong) NSArray *PENG_ZU_ZHI;
@property (nonatomic, strong) NSArray *NUMBER;
@property (nonatomic, strong) NSArray *MONTH;
 
@property (nonatomic, strong) NSArray *SEASON;
@property (nonatomic, strong) NSArray *SHENG_XIAO;
@property (nonatomic, strong) NSArray *QI;
@property (nonatomic, strong) NSArray *JIE;
@property (nonatomic, strong) NSArray *DAY;
@property (nonatomic, strong) NSArray *YUE_XIANG;
 
@property (nonatomic, strong) NSDictionary *FESTIVAL;//农历日期对应的节日
 
@property (nonatomic, strong) NSDictionary *OTHER_FESTIVAL;//农历日期对应的非正式节日
 
 
@property (nonatomic, strong) NSDictionary *XIU;// 28星宿对照表,地支+星期
@property (nonatomic, strong) NSDictionary *XIU_LUCK;// 星宿对应吉凶
@property (nonatomic, strong) NSDictionary *XIU_SONG;// 星宿歌
@property (nonatomic, strong) NSDictionary *SHOU;// 兽
// 地支相冲(子午相冲,丑未相冲,寅申相冲,辰戌相冲,卯酉相冲,巳亥相冲),由于地支对应十二生肖,也就对应了生肖相冲
@property (nonatomic, strong) NSArray *CHONG;
@property (nonatomic, strong) NSArray *CHONG_GAN;// 天干相冲之无情之克(阳克阳,阴克阴)
@property (nonatomic, strong) NSDictionary *CHONG_GAN_BAD;
@property (nonatomic, strong) NSArray *CHONG_GAN_TIE;// 天干相冲之有情之克(阳克阴,阴克阳)
@property (nonatomic, strong) NSDictionary *CHONG_GAN_TIE_GOOD;// 天干五合(有情之克中最有情的5个)
@property (nonatomic, strong) NSDictionary *SHA;// 煞
@property (nonatomic, strong) NSDictionary *POSITION_DESC;// 方位描述
@property (nonatomic, strong) NSDictionary *GONG;// 宫
@property (nonatomic, strong) NSDictionary *ZHENG;// 政
@property (nonatomic, strong) NSDictionary *ANIMAL;// 动物
@property (nonatomic, strong) NSDictionary *WU_XING_GAN;// 天干五行
@property (nonatomic, strong) NSDictionary *WU_XING_ZHI;// 地支五行
@property (nonatomic, strong) NSDictionary *NAYIN;// 纳音
@property (nonatomic, strong) NSDictionary *SHI_SHEN_GAN;// 天干十神,日主+天干为键
@property (nonatomic, strong) NSDictionary *SHI_SHEN_ZHI;// 地支十神,日主+地支藏干主气为键
@property (nonatomic, strong) NSDictionary *ZHI_HIDE_GAN;// 地支藏干表,分别为主气、余气、杂气
 
+ (instancetype)share;
 
+ (NSInteger)getDaysOfMonth:(NSInteger)year :(NSInteger)month;
+ (NSInteger)getLeapMonth:(NSInteger)year;
+ (NSInteger)nextMonth:(NSInteger)y :(NSInteger)m;
+ (NSInteger)computeAddDays:(NSInteger)year :(NSInteger)month :(NSInteger)day;
+ (NSInteger)getTimeZhiIndex:(NSString *)hm;
+ (NSString *)convertTime:(NSString *)hm;
 
+ (NSArray *)getDayYi:(NSString *)monthGanZhi :(NSString *)dayGanZhi;
+ (NSArray *)getDayJi:(NSString *)monthGanZhi :(NSString *)dayGanZhi;
 
+ (NSArray *)getDayJiShen:(NSInteger)lunarMonth :(NSString *)dayGanZhi;
+ (NSArray *)getDayXiongSha:(NSInteger)lunarMonth :(NSString *)dayGanZhi;
 
+ (NSArray *)getTimeYi:(NSString *)dayGanZhi :(NSString *)timeGanZhi;
+ (NSArray *)getTimeJi:(NSString *)dayGanZhi :(NSString *)timeGanZhi;
 
+ (NSInteger)getXunIndex:(NSString *)ganZhi;
+ (NSString *)getXun:(NSString *)ganZhi;
+ (NSString *)getXunKong:(NSString *)ganZhi;
 
+ (NSInteger)getJiaZiIndex:(NSString *)ganZhi;
 
@end
 
/**
 * 节假日
 */
@interface Holiday : NSObject
 
//日期,YYYY-MM-DD格式
@property (nonatomic, strong, readonly) NSString *day;
 
//名称,如:国庆
@property (nonatomic, strong, readonly) NSString *name;
 
//是否调休,即是否要上班
@property (nonatomic, assign, readonly) BOOL work;
 
//关联的节日,YYYY-MM-DD格式
@property (nonatomic, strong, readonly) NSString *target;
 
- (instancetype)initWith:(NSString *)day :(NSString *)name :(BOOL)word :(NSString *)target;
 
@end
 
/**
 * 法定节假日工具(自2001年12月29日起)
 */
@interface HolidayUtil : NSObject
 
//数据段长度:18
@property (nonatomic, assign) NSInteger SIZE;
 
@property (nonatomic, assign) NSInteger ZERO;
 
//节假日名称(元旦0,春节1,清明2,劳动3,端午4,中秋5,国庆6,国庆中秋7,抗战胜利日8)
@property (nonatomic, strong) NSArray *NAMES;
 
//节假日数据,日期YYYYMMDD+名称下标(1位)+是否调休(1位)+对应节日YYYYMMDD
@property (nonatomic, strong) NSString *DATA;
 
+ (instancetype)share;
 
/**
 * 获取指定年月日的节假日信息,如果不存在,返回null
 * @param year 年
 * @param month 月,1-12
 * @param day 日,1-31
 * @return Holiday|null
 */
+ (Holiday *)getHolidayByYmd:(NSInteger)year :(NSInteger)month :(NSInteger)day;
 
/**
 * 获取指定年月日的节假日信息,如果不存在,返回null
 * @param ymd 年月日
 * @return Holiday|null
 */
+ (Holiday *)getHoliday:(NSString *)ymd;
 
/**
 * 获取指定年月的节假日列表
 * @param year 年
 * @param month 月,1-12
 * @return array
 */
+ (NSArray *)getHolidaysByYm:(NSInteger)year :(NSInteger)month;
 
/**
 * 获取指定年的节假日列表
 * @param year 年
 * @return array
 */
+ (NSArray *)getHolidaysByYear:(NSInteger)year;
 
/**
 * 获取指定年月日的节假日列表
 * @param ymd 年、年月、年月日
 * @return array 节假日列表
 */
+ (NSArray *)getHolidays:(NSString *)ymd;
 
/**
 * 获取指定节日(仅节日当天)的相关节假日列表
 * @param year 年
 * @param month 月,1-12
 * @param day 日,1-31
 * @return array
 */
+ (NSArray *)getHolidaysByTargetYmd:(NSInteger)year :(NSInteger)month :(NSInteger)day;
 
/**
 * 获取指定节日(仅节日当天)的相关节假日列表
 * @param ymd 年月日
 * @return array
 */
+ (NSArray *)getHolidaysByTarget:(NSString *)ymd;
 
/**
   * 修正或追加节假日数据。节假日名称下标从0开始,超过9的,按ASCII码表依次往后排列;调休标识0为上班,否则放假
   * @param names 用于替换默认的节假日名称列表,传null即可使用默认名称
   * @param data 需要修正或追加的节假日数据,每18位表示1天依次排列,格式:当天年月日YYYYMMDD(8位)+节假日名称下标(1位)+调休标识(1位)+节假日当天YYYYMMDD(8位)。例:202005023120200501代表2020-05-02为劳动节放假,对应节假日为2020-05-01
   */
- (void)fix:(NSArray *_Nullable)names :(NSString *)data;
 
@end
 
 
/**
 * 大运
 */
@interface DaYun : NSObject
 
//开始年(含)
@property (nonatomic, assign, readonly) NSInteger startYear;
 
//结束年(含)
@property (nonatomic, assign, readonly) NSInteger endYear;
 
//开始年龄(含)
@property (nonatomic, assign, readonly) NSInteger startAge;
 
//结束年龄(含)
@property (nonatomic, assign, readonly) NSInteger endAge;
 
//序数,0-9
@property (nonatomic, assign, readonly) NSInteger index;
 
//运
@property (nonatomic, strong, readonly) Yun *yun;
 
//阴历
@property (nonatomic, strong, readonly) Lunar *lunar;
 
@end
 
 
/**
 * 八字
 */
@interface EightChar : NSObject
 
@property (nonatomic, assign, readonly) NSInteger sect;
@property (nonatomic, strong, readonly) Lunar *lunar;
 
@property (nonatomic, strong) NSDictionary *CHANG_SHENG_OFFSET;
@property (nonatomic, strong) NSArray *MONTH_ZHI;
@property (nonatomic, strong) NSArray *CHANG_SHENG;
 
+ (instancetype)share;
 
+ (instancetype)fromLunar:(Lunar *)lunar;
 
- (NSString *)getYear;
- (NSString *)getMonth;
- (NSString *)getDay;
- (NSString *)getTime;
 
- (NSString *)getYearWuXing;
- (NSString *)getMonthWuXing;
- (NSString *)getDayWuXing;
- (NSString *)getTimeWuXing;
 
- (NSString *)getYearNaYin;
- (NSString *)getMonthNaYin;
- (NSString *)getDayNaYin;
- (NSString *)getTimeNaYin;
 
- (NSString *)getYearShiShenGan;
- (NSString *)getMonthShiShenGan;
- (NSString *)getDayShiShenGan;
- (NSString *)getTimeShiShenGan;
 
- (NSArray *)getYearShiShenZhi;
- (NSArray *)getMonthShiShenZhi;
- (NSArray *)getDayShiShenZhi;
- (NSArray *)getTimeShiShenZhi;
 
@end
 
 
/**
 * 三伏
 * 从夏至后第3个庚日算起,初伏为10天,中伏为10天或20天,末伏为10天。当夏至与立秋之间出现4个庚日时中伏为10天,出现5个庚日则为20天。
 *
 * @package com\nlf\calendar
 */
@interface Fu : NSObject
 
//名称,如:初伏、中伏、末伏
@property (nonatomic, strong, readonly) NSString *name;
//当前入伏第几天,1-20
@property (nonatomic, assign, readonly) NSInteger index;
 
- (instancetype)initWith:(NSString *)name :(NSInteger)index;
 
 
@end
 
 
/**
 * 节气
 */
@interface JieQi : NSObject
 
// 名称
@property (nonatomic, strong, readonly) NSString *name;
// 阳历日期
@property (nonatomic, strong, readonly) Solar *solar;
// 是否节令
@property (nonatomic, assign, readonly) BOOL jie;
// 是否气令
@property (nonatomic, assign, readonly) BOOL qi;
 
- (instancetype)initWith:(NSString *)name :(Solar *)solar;
 
@end
 
 
/**
 * 流年
 */
@interface LiuNian : NSObject
 
//序数,0-9
@property (nonatomic, assign, readonly) NSInteger index;
 
//大运
@property (nonatomic, strong, readonly) DaYun *daYun;
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//年龄
@property (nonatomic, assign, readonly) NSInteger age;
 
//阴历
@property (nonatomic, strong, readonly) Lunar *lunar;
 
- (instancetype)initWith:(DaYun *)daYun :(NSInteger)index;
 
@end
 
 
/**
 * 流月
 */
@interface LiuYue : NSObject
 
//序数,0-9
@property (nonatomic, assign, readonly) NSInteger index;
 
// 流年
@property (nonatomic, strong, readonly) LiuNian *liuNian;
 
- (instancetype)initWith:(LiuNian *)liuNian :(NSInteger)index;
 
@end
 
 
/**
 * 九星
 */
@interface NineStar : NSObject
 
//序号
@property (nonatomic, assign, readonly) NSInteger index;
 
@property (nonatomic, strong) NSArray *NUMBER;//九数
@property (nonatomic, strong) NSArray *COLOR;//七色
@property (nonatomic, strong) NSArray *WU_XING;//五行
@property (nonatomic, strong) NSArray *POSITION;//后天八卦方位
@property (nonatomic, strong) NSArray *NAME_BEI_DOU;//北斗九星
@property (nonatomic, strong) NSArray *NAME_XUAN_KONG;//玄空九星(玄空风水)
@property (nonatomic, strong) NSArray *NAME_QI_MEN;//奇门九星(奇门遁甲,也称天盘九星)
@property (nonatomic, strong) NSArray *BA_MEN_QI_MEN;//八门(奇门遁甲)
@property (nonatomic, strong) NSArray *NAME_TAI_YI;//太乙九神(太乙神数)
@property (nonatomic, strong) NSArray *TYPE_TAI_YI;//太乙九神对应类型
@property (nonatomic, strong) NSArray *SONG_TAI_YI;//太乙九神歌诀(太乙神数)
@property (nonatomic, strong) NSArray *LUCK_XUAN_KONG;//吉凶(玄空风水)
@property (nonatomic, strong) NSArray *LUCK_QI_MEN;//吉凶(奇门遁甲)
@property (nonatomic, strong) NSArray *YIN_YANG_QI_MEN;//阴阳(奇门遁甲)
 
+ (instancetype)share;
 
- (instancetype)initWith:(NSInteger)index;
 
 
@end
 
 
/**
 * 数九
 */
@interface ShuJiu : NSObject
 
//名称,如:一九、二九
@property (nonatomic, strong, readonly) NSString *name;
 
//当前数九第几天,1-9
@property (nonatomic, assign, readonly) NSInteger index;
 
- (instancetype)initWith:(NSString *)name :(NSInteger)index;
 
@end
 
 
/**
 * 阳历日期
 */
@interface Solar : NSObject
 
//2000年儒略日数(2000-1-1 12:00:00 UTC) //2451545
@property (nonatomic, assign) NSInteger J2000;
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//月
@property (nonatomic, assign, readonly) NSInteger month;
 
//日
@property (nonatomic, assign, readonly) NSInteger day;
 
//时
@property (nonatomic, assign, readonly) NSInteger hour;
 
//分
@property (nonatomic, assign, readonly) NSInteger minute;
 
//秒
@property (nonatomic, assign, readonly) NSInteger second;
 
//日期
@property (nonatomic, assign, readonly) NSDate *calendar;
 
+ (instancetype)share;
 
+ (instancetype)fromDate:(NSDate *)date;
 
+ (instancetype)fromJulianDay:(CGFloat)julianDay;
 
- (NSString *)toYmd;
 
- (NSString *)toYmdHms;
 
- (Lunar *)getLunar;
 
@end
 
 
/**
 * 阳历半年
 */
@interface SolarHalfYear : NSObject
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//月
@property (nonatomic, assign, readonly) NSInteger month;
 
//一个半年的月数
@property (nonatomic, assign) NSInteger MONTH_COUNT;
 
+ (instancetype)share;
 
 
@end
 
 
/**
 * 阳历月
 */
@interface SolarMonth : NSObject
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//月
@property (nonatomic, assign, readonly) NSInteger month;
 
 
 
@end
 
 
/**
 * 阳历季度
 */
@interface SolarSeason : NSObject
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//月
@property (nonatomic, assign, readonly) NSInteger month;
 
//一个半年的月数
@property (nonatomic, assign) NSInteger MONTH_COUNT;
 
+ (instancetype)share;
 
@end
 
 
/**
 * 阳历周
 */
@interface SolarWeek : NSObject
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//月
@property (nonatomic, assign, readonly) NSInteger month;
 
//日
@property (nonatomic, assign, readonly) NSInteger day;
 
//星期几作为一周的开始,1234560分别代表星期一至星期天
@property (nonatomic, assign, readonly) NSInteger start;
 
 
@end
 
 
/**
 * 阳历年
 */
@interface SolarYear : NSObject
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//一年的月数
@property (nonatomic, assign) NSInteger MONTH_COUNT;
 
+ (instancetype)share;
 
@end
 
 
/**
 * 小运
 */
@interface XiaoYun : NSObject
 
//序数,0-9
@property (nonatomic, assign, readonly) NSInteger index;
 
//大运
@property (nonatomic, strong, readonly) DaYun *daYun;
 
//年
@property (nonatomic, assign, readonly) NSInteger year;
 
//年龄
@property (nonatomic, assign, readonly) NSInteger age;
 
//阴历
@property (nonatomic, strong, readonly) Lunar *lunar;
 
//是否顺推
@property (nonatomic, assign, readonly) BOOL forward;
 
- (instancetype)initWith:(DaYun *)daYun :(NSInteger)index :(BOOL)forward;
 
@end
 
/**
 * 运
 */
@interface Yun : NSObject
 
//性别,1男,0女
@property (nonatomic, assign, readonly) NSInteger gender;
 
//起运年数
@property (nonatomic, assign, readonly) NSInteger startYear;
 
//起运月数
@property (nonatomic, assign, readonly) NSInteger startMonth;
 
//起运天数
@property (nonatomic, assign, readonly) NSInteger startDay;
 
//是否顺推
@property (nonatomic, assign, readonly) BOOL forward;
 
//阴历日期
@property (nonatomic, strong, readonly) Lunar *lunar;
 
- (Solar *)getStartSolar;
 
@end
 
 
NS_ASSUME_NONNULL_END