6 extern const CFUInt16 LUNAR_START_YEAR;
7 extern const CFUInt16 LUNAR_END_YEAR;
11 CFUInt16 m_year, m_month, m_day;
13 static void l_calcLunarDate(CFUInt16 &iYear, CFUInt16 &iMonth ,
14 CFUInt16 &iDay,
long iSpanDays);
15 static CFUInt16 l_getLunarHolDay(CFUInt16 iYear, CFUInt16 iMonth,
19 CFLunar(CFUInt16 iYear, CFUInt16 iMonth, CFUInt16 iDay);
21 CFUInt16 getYear() {
return m_year;}
22 CFUInt16 getMonth() {
return m_month;}
23 CFUInt16 getDay() {
return m_day;}
25 void getDate(CFUInt16 &iYear, CFUInt16 &iMonth, CFUInt16 &iDay);
26 int setDate(CFUInt16 iYear, CFUInt16 iMonth, CFUInt16 iDay);
28 static int isLeapYear(CFUInt16 iYear) {
return !(iYear%4)&&(iYear%100) || !(iYear%400);}
29 static CFUInt16 weekDay(CFUInt16 iYear, CFUInt16 iMonth, CFUInt16 iDay);
30 static void formatWeekDay (CFUInt16 iYear, CFUInt16 iMonth, CFUInt16 iDay,
char *pBuffer);
31 static CFUInt16 monthDays(CFUInt16 iYear, CFUInt16 iMonth);
33 static long lunarMonthDays(CFUInt16 iLunarYear, CFUInt16 iLunarMonth);
34 static CFUInt16 lunarYearDays(CFUInt16 iLunarYear);
36 static CFUInt16 getLeapMonth(CFUInt16 iLunarYear);
37 static bool getFormatLeapMonth (CFUInt16 iLunarYear,
char *pBuffer);
39 static void formatLunarYear(CFUInt16 iLunarYear,
char *pBuffer);
40 static void formatLunarMonth(CFUInt16 iLunarMonth,
char *pBuffer);
41 static void formatLunarDay(CFUInt16 iLunarDay,
char *pBuffer);
43 static long calcDateDiff(CFUInt16 iEndYear, CFUInt16 iEndMonth,
44 CFUInt16 iEndDay, CFUInt16 iStartYear = LUNAR_START_YEAR,
45 CFUInt16 iStartMonth = 1, CFUInt16 iStartDay = 1);
47 static void getLunarDate(CFUInt16 iYear, CFUInt16 iMonth,
48 CFUInt16 iDay, CFUInt16 &iLunarYear,
49 CFUInt16 &iLunarMonth, CFUInt16 &iLunarDay);
50 static void getFormatLunarDate (CFUInt16 iYear, CFUInt16 iMonth, CFUInt16 iDay,
char *pBuffer);
52 static bool getSolarTerm (CFUInt16 iYear, CFUInt16 iMonth, CFUInt16 iDay,
char *pBuffer);
54 #endif //__CFLUNAR_H__