From fb8a05f02e254a623cddd6a39be7638634bbd7fe Mon Sep 17 00:00:00 2001 From: dingwenchao Date: Sun, 29 Nov 2015 19:00:56 +0800 Subject: [PATCH] Update 1.7.1.beta 1. Supports font customisation 2. Supports titleVerticalOffset and subtitleVerticalOffset 3. Remove SSLunarDate dependency, use NSCalendar and NSCalendarIdentifierChinese instead --- Example/FSCalendar.xcodeproj/project.pbxproj | 112 +-- Example/SSLunarDate/SSHolidayCA.h | 15 - Example/SSLunarDate/SSHolidayCA.m | 93 -- Example/SSLunarDate/SSHolidayChina.h | 16 - Example/SSLunarDate/SSHolidayChina.m | 55 -- Example/SSLunarDate/SSHolidayCountry.h | 26 - Example/SSLunarDate/SSHolidayCountry.m | 77 -- Example/SSLunarDate/SSHolidayHK.h | 13 - Example/SSLunarDate/SSHolidayHK.m | 92 -- Example/SSLunarDate/SSHolidayManager.h | 48 - Example/SSLunarDate/SSHolidayManager.m | 79 -- Example/SSLunarDate/SSHolidayTW.h | 16 - Example/SSLunarDate/SSHolidayTW.m | 53 -- Example/SSLunarDate/SSHolidayUK.h | 14 - Example/SSLunarDate/SSHolidayUK.m | 97 -- Example/SSLunarDate/SSHolidayUS.h | 16 - Example/SSLunarDate/SSHolidayUS.m | 102 -- Example/SSLunarDate/SSHolidayWest.h | 69 -- Example/SSLunarDate/SSHolidayWest.m | 298 ------ Example/SSLunarDate/SSLunarDate-Prefix.pch | 7 - Example/SSLunarDate/SSLunarDate.h | 65 -- Example/SSLunarDate/SSLunarDate.m | 180 ---- Example/SSLunarDate/SSLunarDateFormatter.h | 47 - Example/SSLunarDate/SSLunarDateFormatter.m | 277 ------ Example/SSLunarDate/SSLunarDateHoliday.h | 45 - Example/SSLunarDate/SSLunarDateHoliday.m | 199 ---- Example/SSLunarDate/SSLunarDateType.h | 49 - .../en.lproj/LunarDateFormatter.strings | Bin 13104 -> 0 bytes .../ja.lproj/LunarDateFormatter.strings | Bin 13104 -> 0 bytes Example/SSLunarDate/libLunar.c | 880 ------------------ Example/SSLunarDate/libLunar.h | 38 - .../zh-Hans.lproj/LunarDateFormatter.strings | Bin 12838 -> 0 bytes .../zh-Hant.lproj/LunarDateFormatter.strings | Bin 12836 -> 0 bytes Example/StoryboardExampleViewController.m | 15 +- FSCalendar.podspec | 2 +- FSCalendar/FSCalendar+IBExtension.h | 5 +- FSCalendar/FSCalendar+IBExtension.m | 118 +-- FSCalendar/FSCalendar.m | 10 +- FSCalendar/FSCalendarAppearance.h | 24 +- FSCalendar/FSCalendarAppearance.m | 279 ++++-- FSCalendar/FSCalendarCell.m | 12 +- FSCalendar/FSCalendarDynamicHeader.h | 5 + FSCalendar/FSCalendarHeader.m | 7 +- FSCalendar/FSCalendarStickyHeader.m | 10 +- FSCalendar/Info.plist | 2 +- 45 files changed, 332 insertions(+), 3235 deletions(-) delete mode 100755 Example/SSLunarDate/SSHolidayCA.h delete mode 100755 Example/SSLunarDate/SSHolidayCA.m delete mode 100755 Example/SSLunarDate/SSHolidayChina.h delete mode 100755 Example/SSLunarDate/SSHolidayChina.m delete mode 100755 Example/SSLunarDate/SSHolidayCountry.h delete mode 100755 Example/SSLunarDate/SSHolidayCountry.m delete mode 100755 Example/SSLunarDate/SSHolidayHK.h delete mode 100755 Example/SSLunarDate/SSHolidayHK.m delete mode 100755 Example/SSLunarDate/SSHolidayManager.h delete mode 100755 Example/SSLunarDate/SSHolidayManager.m delete mode 100755 Example/SSLunarDate/SSHolidayTW.h delete mode 100755 Example/SSLunarDate/SSHolidayTW.m delete mode 100755 Example/SSLunarDate/SSHolidayUK.h delete mode 100755 Example/SSLunarDate/SSHolidayUK.m delete mode 100755 Example/SSLunarDate/SSHolidayUS.h delete mode 100755 Example/SSLunarDate/SSHolidayUS.m delete mode 100755 Example/SSLunarDate/SSHolidayWest.h delete mode 100755 Example/SSLunarDate/SSHolidayWest.m delete mode 100755 Example/SSLunarDate/SSLunarDate-Prefix.pch delete mode 100755 Example/SSLunarDate/SSLunarDate.h delete mode 100755 Example/SSLunarDate/SSLunarDate.m delete mode 100755 Example/SSLunarDate/SSLunarDateFormatter.h delete mode 100755 Example/SSLunarDate/SSLunarDateFormatter.m delete mode 100755 Example/SSLunarDate/SSLunarDateHoliday.h delete mode 100755 Example/SSLunarDate/SSLunarDateHoliday.m delete mode 100755 Example/SSLunarDate/SSLunarDateType.h delete mode 100755 Example/SSLunarDate/en.lproj/LunarDateFormatter.strings delete mode 100755 Example/SSLunarDate/ja.lproj/LunarDateFormatter.strings delete mode 100755 Example/SSLunarDate/libLunar.c delete mode 100755 Example/SSLunarDate/libLunar.h delete mode 100755 Example/SSLunarDate/zh-Hans.lproj/LunarDateFormatter.strings delete mode 100755 Example/SSLunarDate/zh-Hant.lproj/LunarDateFormatter.strings diff --git a/Example/FSCalendar.xcodeproj/project.pbxproj b/Example/FSCalendar.xcodeproj/project.pbxproj index ffda329..5f98df8 100644 --- a/Example/FSCalendar.xcodeproj/project.pbxproj +++ b/Example/FSCalendar.xcodeproj/project.pbxproj @@ -41,20 +41,6 @@ 30FCB3971BAAD112002B87AD /* FSCalendarStickyHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 30FCB3951BAAD112002B87AD /* FSCalendarStickyHeader.m */; }; 30FCB3981BAAD112002B87AD /* FSCalendarStickyHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 30FCB3951BAAD112002B87AD /* FSCalendarStickyHeader.m */; }; EE52AE181B91E68A00016662 /* FSCalendarScopeExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EE52AE171B91E68A00016662 /* FSCalendarScopeExampleViewController.m */; }; - EE638CB21B89DB450006DD1A /* LunarDateFormatter.strings in Resources */ = {isa = PBXBuildFile; fileRef = EE638C911B89DB450006DD1A /* LunarDateFormatter.strings */; }; - EE638CB31B89DB450006DD1A /* libLunar.c in Sources */ = {isa = PBXBuildFile; fileRef = EE638C941B89DB450006DD1A /* libLunar.c */; }; - EE638CB41B89DB450006DD1A /* SSHolidayCA.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638C971B89DB450006DD1A /* SSHolidayCA.m */; }; - EE638CB51B89DB450006DD1A /* SSHolidayChina.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638C991B89DB450006DD1A /* SSHolidayChina.m */; }; - EE638CB61B89DB450006DD1A /* SSHolidayCountry.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638C9B1B89DB450006DD1A /* SSHolidayCountry.m */; }; - EE638CB71B89DB450006DD1A /* SSHolidayHK.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638C9D1B89DB450006DD1A /* SSHolidayHK.m */; }; - EE638CB81B89DB450006DD1A /* SSHolidayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638C9F1B89DB450006DD1A /* SSHolidayManager.m */; }; - EE638CB91B89DB450006DD1A /* SSHolidayTW.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CA11B89DB450006DD1A /* SSHolidayTW.m */; }; - EE638CBA1B89DB450006DD1A /* SSHolidayUK.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CA31B89DB450006DD1A /* SSHolidayUK.m */; }; - EE638CBB1B89DB450006DD1A /* SSHolidayUS.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CA51B89DB450006DD1A /* SSHolidayUS.m */; }; - EE638CBC1B89DB450006DD1A /* SSHolidayWest.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CA71B89DB450006DD1A /* SSHolidayWest.m */; }; - EE638CBD1B89DB450006DD1A /* SSLunarDate.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CAA1B89DB450006DD1A /* SSLunarDate.m */; }; - EE638CBE1B89DB450006DD1A /* SSLunarDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CAC1B89DB450006DD1A /* SSLunarDateFormatter.m */; }; - EE638CBF1B89DB450006DD1A /* SSLunarDateHoliday.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CAE1B89DB450006DD1A /* SSLunarDateHoliday.m */; }; EE638CC31B89DB6E0006DD1A /* LoadViewExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CC21B89DB6E0006DD1A /* LoadViewExampleViewController.m */; }; EE638CC61B89DB7D0006DD1A /* ViewDidLoadExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CC51B89DB7D0006DD1A /* ViewDidLoadExampleViewController.m */; }; EE638CC91B89DB940006DD1A /* CalendarConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EE638CC81B89DB940006DD1A /* CalendarConfigViewController.m */; }; @@ -132,38 +118,6 @@ EE0D7FCB1B89C5D3003C287B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; EE52AE161B91E68A00016662 /* FSCalendarScopeExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarScopeExampleViewController.h; sourceTree = SOURCE_ROOT; }; EE52AE171B91E68A00016662 /* FSCalendarScopeExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarScopeExampleViewController.m; sourceTree = SOURCE_ROOT; }; - EE638C921B89DB450006DD1A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LunarDateFormatter.strings; sourceTree = ""; }; - EE638C931B89DB450006DD1A /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LunarDateFormatter.strings; sourceTree = ""; }; - EE638C941B89DB450006DD1A /* libLunar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libLunar.c; sourceTree = ""; }; - EE638C951B89DB450006DD1A /* libLunar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libLunar.h; sourceTree = ""; }; - EE638C961B89DB450006DD1A /* SSHolidayCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayCA.h; sourceTree = ""; }; - EE638C971B89DB450006DD1A /* SSHolidayCA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayCA.m; sourceTree = ""; }; - EE638C981B89DB450006DD1A /* SSHolidayChina.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayChina.h; sourceTree = ""; }; - EE638C991B89DB450006DD1A /* SSHolidayChina.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayChina.m; sourceTree = ""; }; - EE638C9A1B89DB450006DD1A /* SSHolidayCountry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayCountry.h; sourceTree = ""; }; - EE638C9B1B89DB450006DD1A /* SSHolidayCountry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayCountry.m; sourceTree = ""; }; - EE638C9C1B89DB450006DD1A /* SSHolidayHK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayHK.h; sourceTree = ""; }; - EE638C9D1B89DB450006DD1A /* SSHolidayHK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayHK.m; sourceTree = ""; }; - EE638C9E1B89DB450006DD1A /* SSHolidayManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayManager.h; sourceTree = ""; }; - EE638C9F1B89DB450006DD1A /* SSHolidayManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayManager.m; sourceTree = ""; }; - EE638CA01B89DB450006DD1A /* SSHolidayTW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayTW.h; sourceTree = ""; }; - EE638CA11B89DB450006DD1A /* SSHolidayTW.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayTW.m; sourceTree = ""; }; - EE638CA21B89DB450006DD1A /* SSHolidayUK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayUK.h; sourceTree = ""; }; - EE638CA31B89DB450006DD1A /* SSHolidayUK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayUK.m; sourceTree = ""; }; - EE638CA41B89DB450006DD1A /* SSHolidayUS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayUS.h; sourceTree = ""; }; - EE638CA51B89DB450006DD1A /* SSHolidayUS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayUS.m; sourceTree = ""; }; - EE638CA61B89DB450006DD1A /* SSHolidayWest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHolidayWest.h; sourceTree = ""; }; - EE638CA71B89DB450006DD1A /* SSHolidayWest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHolidayWest.m; sourceTree = ""; }; - EE638CA81B89DB450006DD1A /* SSLunarDate-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SSLunarDate-Prefix.pch"; sourceTree = ""; }; - EE638CA91B89DB450006DD1A /* SSLunarDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLunarDate.h; sourceTree = ""; }; - EE638CAA1B89DB450006DD1A /* SSLunarDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSLunarDate.m; sourceTree = ""; }; - EE638CAB1B89DB450006DD1A /* SSLunarDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLunarDateFormatter.h; sourceTree = ""; }; - EE638CAC1B89DB450006DD1A /* SSLunarDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSLunarDateFormatter.m; sourceTree = ""; }; - EE638CAD1B89DB450006DD1A /* SSLunarDateHoliday.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLunarDateHoliday.h; sourceTree = ""; }; - EE638CAE1B89DB450006DD1A /* SSLunarDateHoliday.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSLunarDateHoliday.m; sourceTree = ""; }; - EE638CAF1B89DB450006DD1A /* SSLunarDateType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLunarDateType.h; sourceTree = ""; }; - EE638CB01B89DB450006DD1A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LunarDateFormatter.strings"; sourceTree = ""; }; - EE638CB11B89DB450006DD1A /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/LunarDateFormatter.strings"; sourceTree = ""; }; EE638CC11B89DB6E0006DD1A /* LoadViewExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadViewExampleViewController.h; sourceTree = SOURCE_ROOT; }; EE638CC21B89DB6E0006DD1A /* LoadViewExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoadViewExampleViewController.m; sourceTree = SOURCE_ROOT; }; EE638CC41B89DB7D0006DD1A /* ViewDidLoadExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewDidLoadExampleViewController.h; sourceTree = SOURCE_ROOT; }; @@ -316,7 +270,6 @@ EE0D80241B89C868003C287B /* Storyboard Example */, EE0D80231B89C853003C287B /* LoadView Example */, EE0D80251B89C874003C287B /* ViewDidLoad Example */, - EE638C901B89DB450006DD1A /* SSLunarDate */, EE638CDB1B89DC230006DD1A /* Images.xcassets */, EE0D7FCA1B89C5D3003C287B /* Supporting Files */, ); @@ -370,42 +323,6 @@ name = "FSCalendarScope Example"; sourceTree = ""; }; - EE638C901B89DB450006DD1A /* SSLunarDate */ = { - isa = PBXGroup; - children = ( - EE638C911B89DB450006DD1A /* LunarDateFormatter.strings */, - EE638C941B89DB450006DD1A /* libLunar.c */, - EE638C951B89DB450006DD1A /* libLunar.h */, - EE638C961B89DB450006DD1A /* SSHolidayCA.h */, - EE638C971B89DB450006DD1A /* SSHolidayCA.m */, - EE638C981B89DB450006DD1A /* SSHolidayChina.h */, - EE638C991B89DB450006DD1A /* SSHolidayChina.m */, - EE638C9A1B89DB450006DD1A /* SSHolidayCountry.h */, - EE638C9B1B89DB450006DD1A /* SSHolidayCountry.m */, - EE638C9C1B89DB450006DD1A /* SSHolidayHK.h */, - EE638C9D1B89DB450006DD1A /* SSHolidayHK.m */, - EE638C9E1B89DB450006DD1A /* SSHolidayManager.h */, - EE638C9F1B89DB450006DD1A /* SSHolidayManager.m */, - EE638CA01B89DB450006DD1A /* SSHolidayTW.h */, - EE638CA11B89DB450006DD1A /* SSHolidayTW.m */, - EE638CA21B89DB450006DD1A /* SSHolidayUK.h */, - EE638CA31B89DB450006DD1A /* SSHolidayUK.m */, - EE638CA41B89DB450006DD1A /* SSHolidayUS.h */, - EE638CA51B89DB450006DD1A /* SSHolidayUS.m */, - EE638CA61B89DB450006DD1A /* SSHolidayWest.h */, - EE638CA71B89DB450006DD1A /* SSHolidayWest.m */, - EE638CA81B89DB450006DD1A /* SSLunarDate-Prefix.pch */, - EE638CA91B89DB450006DD1A /* SSLunarDate.h */, - EE638CAA1B89DB450006DD1A /* SSLunarDate.m */, - EE638CAB1B89DB450006DD1A /* SSLunarDateFormatter.h */, - EE638CAC1B89DB450006DD1A /* SSLunarDateFormatter.m */, - EE638CAD1B89DB450006DD1A /* SSLunarDateHoliday.h */, - EE638CAE1B89DB450006DD1A /* SSLunarDateHoliday.m */, - EE638CAF1B89DB450006DD1A /* SSLunarDateType.h */, - ); - path = SSLunarDate; - sourceTree = SOURCE_ROOT; - }; EE638CF21B8A1F550006DD1A /* FSCalendarTests */ = { isa = PBXGroup; children = ( @@ -543,7 +460,6 @@ EE638CDC1B89DC230006DD1A /* Images.xcassets in Resources */, EE638CD91B89DC0A0006DD1A /* Main_iPad.storyboard in Resources */, 30B0BAD51B8D8E23004B9476 /* Info.plist in Resources */, - EE638CB21B89DB450006DD1A /* LunarDateFormatter.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -570,34 +486,21 @@ 3092253B1B905C4300123031 /* FSCalendarConstance.m in Sources */, 30F5D85A1B9FC4BB00C1C201 /* MultipleSelectionViewController.m in Sources */, 30FCB3971BAAD112002B87AD /* FSCalendarStickyHeader.m in Sources */, - EE638CBC1B89DB450006DD1A /* SSHolidayWest.m in Sources */, - EE638CBB1B89DB450006DD1A /* SSHolidayUS.m in Sources */, 30B0BAD21B8D8E23004B9476 /* FSCalendarCell.m in Sources */, 30B0BAD71B8D8E23004B9476 /* UIView+FSExtension.m in Sources */, EE638CD41B89DBE90006DD1A /* FSTableViewController.m in Sources */, 3084BD191BF9AB8100C956F7 /* CalendarIdentifierViewController.m in Sources */, EE638CCB1B89DBAC0006DD1A /* main.m in Sources */, - EE638CB51B89DB450006DD1A /* SSHolidayChina.m in Sources */, 30B0BAD11B8D8E23004B9476 /* FSCalendarAppearance.m in Sources */, EEC9C0351BDC8F7000383A07 /* FSCalendarFlowLayout.m in Sources */, - EE638CB31B89DB450006DD1A /* libLunar.c in Sources */, - EE638CBA1B89DB450006DD1A /* SSHolidayUK.m in Sources */, EE638CC61B89DB7D0006DD1A /* ViewDidLoadExampleViewController.m in Sources */, - EE638CB91B89DB450006DD1A /* SSHolidayTW.m in Sources */, 30B0BACF1B8D8E23004B9476 /* FSCalendar+IBExtension.m in Sources */, - EE638CBE1B89DB450006DD1A /* SSLunarDateFormatter.m in Sources */, - EE638CB71B89DB450006DD1A /* SSHolidayHK.m in Sources */, EEC9C03A1BDC9E7000383A07 /* FSCalendarCollectionView.m in Sources */, EE89AF9F1B9162B90001B657 /* NSString+FSExtension.m in Sources */, - EE638CB81B89DB450006DD1A /* SSHolidayManager.m in Sources */, EE52AE181B91E68A00016662 /* FSCalendarScopeExampleViewController.m in Sources */, - EE638CBF1B89DB450006DD1A /* SSLunarDateHoliday.m in Sources */, - EE638CB41B89DB450006DD1A /* SSHolidayCA.m in Sources */, 30024F951BD1015300B1C04C /* DelegateAppearanceViewController.m in Sources */, EE638CC31B89DB6E0006DD1A /* LoadViewExampleViewController.m in Sources */, 30B0BAD31B8D8E23004B9476 /* FSCalendarHeader.m in Sources */, - EE638CBD1B89DB450006DD1A /* SSLunarDate.m in Sources */, - EE638CB61B89DB450006DD1A /* SSHolidayCountry.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -631,17 +534,6 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - EE638C911B89DB450006DD1A /* LunarDateFormatter.strings */ = { - isa = PBXVariantGroup; - children = ( - EE638C921B89DB450006DD1A /* en */, - EE638C931B89DB450006DD1A /* ja */, - EE638CB01B89DB450006DD1A /* zh-Hans */, - EE638CB11B89DB450006DD1A /* zh-Hant */, - ); - name = LunarDateFormatter.strings; - sourceTree = ""; - }; EE638CD51B89DC090006DD1A /* Main_iPad.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -786,7 +678,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.wenchao.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.wenchao.FSCalendar; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; @@ -807,7 +699,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.wenchao.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.wenchao.FSCalendar; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Example/SSLunarDate/SSHolidayCA.h b/Example/SSLunarDate/SSHolidayCA.h deleted file mode 100755 index 1c8bda7..0000000 --- a/Example/SSLunarDate/SSHolidayCA.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// SSHolidayCA.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" - -@interface SSHolidayCA : SSHolidayCountry - -- (NSArray *) getHolidayListForDate:(NSDate *)date; - -@end diff --git a/Example/SSLunarDate/SSHolidayCA.m b/Example/SSLunarDate/SSHolidayCA.m deleted file mode 100755 index f7ed3bf..0000000 --- a/Example/SSLunarDate/SSHolidayCA.m +++ /dev/null @@ -1,93 +0,0 @@ -// -// SSHolidayCA.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCA.h" -#import "SSLunarDateHoliday.h" -#import "SSHolidayWest.h" - -@interface SSHolidayCA() -{ - NSDictionary *_solarHolidayCA; - NSDictionary *_variableHoliday; - int _cachedYear; -} - -@property (readonly) NSDictionary *solarHolidayCA; -@property (readonly) NSDictionary *variableHoliday; - -@end - -@implementation SSHolidayCA - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ -// 1. add table holiday -// 2. add selected wester holiday - NSMutableArray *result = [[NSMutableArray alloc] init]; - - [result addObjectsFromArray: [SSHolidayCountry getHolidayListFromTable:date - calendar:self.calendar - dict:[self solarHolidayCA]]]; - - NSDateComponents *c = [self.calendar components:NSYearCalendarUnit fromDate:date]; - - if (_cachedYear != c.year) { - _cachedYear = (int)c.year; - _variableHoliday = nil; - } - - [result addObjectsFromArray:[SSHolidayCountry getHolidayListFromTable:date calendar:self.calendar dict:[self variableHoliday]]]; - return result; -} - - --(NSDictionary *) variableHoliday { - if (_variableHoliday == nil) { - NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; - - NSDate *d; - - d = [self.west getGoodFriday:_cachedYear]; - [dict setObject:HOLIDAY_GOOD_FRIDAY forKey:[self convertDateIndex:d]]; - - d = [self.west getEasterMonday:_cachedYear]; - [dict setObject:HOLIDAY_EASTER_MONDAY - forKey:[self convertDateIndex:d]]; - - d = [self.west getLaborDay:_cachedYear]; - [dict setObject:HOLIDAY_LABOR_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getThanksGivingDay:_cachedYear]; - [dict setObject:HOLIDAY_THANKS_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getVictoriaDay:_cachedYear]; - [dict setObject:HOLIDAY_VICTORIA_DAY forKey:[self convertDateIndex:d]]; - - _variableHoliday = dict; - } - - return _variableHoliday; -} -// 1. Good Friday -// 2. Labor 's day - -- (NSDictionary *) solarHolidayCA -{ - if (!_solarHolidayCA) - _solarHolidayCA = @{@"0101":NSLocalizedString(@"New Year's Day",""), - @"0214":NSLocalizedString(@"Valentine",""), - @"0701":NSLocalizedString(@"Canada Day",""), - @"1111":NSLocalizedString(@"Remembrance Day",""), - @"1225":NSLocalizedString(@"Christmas Day",""), - @"1226":NSLocalizedString(@"Boxing Day","") - }; - return _solarHolidayCA; - -} - -@end diff --git a/Example/SSLunarDate/SSHolidayChina.h b/Example/SSLunarDate/SSHolidayChina.h deleted file mode 100755 index 2a5a284..0000000 --- a/Example/SSLunarDate/SSHolidayChina.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SSHolidayChina.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" - -@interface SSHolidayChina : SSHolidayCountry - -- (NSArray *) getHolidayListForDate:(NSDate *)date; - - -@end diff --git a/Example/SSLunarDate/SSHolidayChina.m b/Example/SSLunarDate/SSHolidayChina.m deleted file mode 100755 index c559572..0000000 --- a/Example/SSLunarDate/SSHolidayChina.m +++ /dev/null @@ -1,55 +0,0 @@ -// -// SSHolidayChina.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayChina.h" -#import "SSLunarDate.h" - -@interface SSHolidayChina() -{ - NSDictionary *_solarHolidayCN; -} - -@property (readonly) NSDictionary *solarHolidayCN; -@end - - -@implementation SSHolidayChina - -- (NSDictionary *) solarHolidayCN -{ - if (!_solarHolidayCN) - _solarHolidayCN = @{ - @"0101":NSLocalizedString(@"元旦",""), - @"0214":NSLocalizedString(@"情人节",""), - @"0308":NSLocalizedString(@"妇女节",""), - @"0501":NSLocalizedString(@"劳动节",""), - @"0601":NSLocalizedString(@"儿童节",""), - @"0801":NSLocalizedString(@"建军节", ""), - @"0910":NSLocalizedString(@"教师节",""), - @"1001":NSLocalizedString(@"国庆节",""), - @"1225":NSLocalizedString(@"圣诞节","") - }; - - return _solarHolidayCN; -} - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ - NSMutableArray *result = [[NSMutableArray alloc] init]; - SSLunarDate *lunarDate = [[SSLunarDate alloc] initWithDate:date - calendar:self.calendar]; - NSString *lunar = [lunarDate getLunarHolidayNameWithRegion:self.region]; - if (lunar != nil) - [result addObject:lunar]; - [result addObjectsFromArray: [SSHolidayCountry getHolidayListFromTable:date - calendar:self.calendar - dict:self.solarHolidayCN]]; - return result; -} - -@end diff --git a/Example/SSLunarDate/SSHolidayCountry.h b/Example/SSLunarDate/SSHolidayCountry.h deleted file mode 100755 index 2b833a1..0000000 --- a/Example/SSLunarDate/SSHolidayCountry.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// SSHolidayCountry.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import -#import "SSHolidayManager.h" -#import "SSHolidayWest.h" - -@interface SSHolidayCountry : NSObject -- (id) initWithRegion:(SSHolidayRegion) region; -- (NSArray *) getHolidayListForDate:(NSDate *)date; -+ (NSArray *) getHolidayListFromTable:(NSDate *)date - calendar:(NSCalendar *)cal - dict:(NSDictionary *) dict; - -@property (strong, nonatomic) NSCalendar *calendar; -@property (strong, nonatomic) SSHolidayWest *west; -@property SSHolidayRegion region; - -- (NSString*)convertDateIndex: (NSDate*)date; - -@end diff --git a/Example/SSLunarDate/SSHolidayCountry.m b/Example/SSLunarDate/SSHolidayCountry.m deleted file mode 100755 index abb2cf2..0000000 --- a/Example/SSLunarDate/SSHolidayCountry.m +++ /dev/null @@ -1,77 +0,0 @@ -// -// SSHolidayCountry.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" -#import "SSLunarDate.h" -#import "SSLunarDateHoliday.h" - -@interface SSHolidayCountry () -{ - SSHolidayRegion _region; - NSCalendar *_calendar; - SSHolidayWest *_west; -} -@end - -@implementation SSHolidayCountry - -@synthesize calendar, region; - -- (id) initWithRegion:(SSHolidayRegion) reg -{ - self = [super init]; - if (self) { - _region = reg; - _calendar = [NSCalendar currentCalendar]; - } - return self; -} - -- (NSCalendar *) calendar { - if (_calendar == nil) - _calendar = [NSCalendar currentCalendar]; - return _calendar; -} - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ - NSAssert(false, @"NSHolidayCountry dummy function called"); - return [NSArray array]; -} - -+ (NSArray *) getHolidayListFromTable:(NSDate *)date - calendar:(NSCalendar *)cal - dict:(NSDictionary *) dict -{ - NSString *index; - NSMutableArray *result = [[NSMutableArray alloc] init]; - unsigned int flags = NSYearCalendarUnit - | NSMonthCalendarUnit | NSDayCalendarUnit; - NSDateComponents *parts = [cal components:flags fromDate:date]; - index = [SSLunarDateHoliday convertIndexFrom:(int)parts.month day:(int)parts.day]; - - NSString *holiday = [dict objectForKey:index]; - if (holiday) - [result addObject:holiday]; - return result; -} - --(NSString *) convertDateIndex:(NSDate *)date -{ - NSDateComponents *c = [self.calendar components: NSDayCalendarUnit | NSMonthCalendarUnit fromDate:date]; - return [SSLunarDateHoliday convertIndexFrom:(int)c.month day:(int)c.day]; -} - -- (SSHolidayWest *) west -{ - if (_west == nil) - _west = [[SSHolidayWest alloc] initWithCalendar:self.calendar]; - return _west; -} - -@end diff --git a/Example/SSLunarDate/SSHolidayHK.h b/Example/SSLunarDate/SSHolidayHK.h deleted file mode 100755 index 9148e7a..0000000 --- a/Example/SSLunarDate/SSHolidayHK.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// SSHolidayHK.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" - -@interface SSHolidayHK : SSHolidayCountry -- (NSArray *) getHolidayListForDate:(NSDate *)date; -@end diff --git a/Example/SSLunarDate/SSHolidayHK.m b/Example/SSLunarDate/SSHolidayHK.m deleted file mode 100755 index 321d994..0000000 --- a/Example/SSLunarDate/SSHolidayHK.m +++ /dev/null @@ -1,92 +0,0 @@ -// -// SSHolidayHK.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayHK.h" -#import "SSLunarDate.h" - -@interface SSHolidayHK() -{ - NSDictionary *_solarHolidayHK; - NSDictionary *_variableHoliday; - int _cachedYear; -} - -@property (readonly) NSDictionary *solarHolidayTW; -@property (readonly) NSDictionary *variableHoliday; - -@end - -@implementation SSHolidayHK - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ - NSMutableArray *result = [[NSMutableArray alloc] init]; - SSLunarDate *lunarDate = [[SSLunarDate alloc] initWithDate:date - calendar:self.calendar]; - - NSDateComponents *c = [self.calendar components:NSYearCalendarUnit fromDate:date]; - - NSAssert(c.year != 0, @"should not zero"); - if (_cachedYear != c.year) { - _cachedYear = (int)c.year; - _variableHoliday = nil; - } - - NSString *lunar = [lunarDate getLunarHolidayNameWithRegion:self.region]; - if (lunar != nil) - [result addObject:lunar]; - [result addObjectsFromArray: [SSHolidayCountry getHolidayListFromTable:date - calendar:self.calendar - dict:self.solarHolidayHK]]; - - [result addObjectsFromArray:[SSHolidayCountry getHolidayListFromTable:date calendar:self.calendar dict:[self variableHoliday]]]; - - - return result; -} - --(NSDictionary *) variableHoliday { - if (_variableHoliday == nil) { - NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; - - NSDate *d; - - d = [self.west getGoodFriday:_cachedYear]; - [dict setObject:HOLIDAY_GOOD_FRIDAY forKey:[self convertDateIndex:d]]; - - d = [self.west getGoodFridayNextDay:_cachedYear]; - [dict setObject:HOLIDAY_GOOD_FRIDAY_NEXT forKey:[self convertDateIndex:d]]; - d = [self.west getEasterMonday:_cachedYear]; - [dict setObject:HOLIDAY_EASTER_MONDAY - forKey:[self convertDateIndex:d]]; - - _variableHoliday = dict; - } - - return _variableHoliday; -} - -// 1. Good Firday, -// 2. Good Firday + 1 -// 3. Easter + 1 -- (NSDictionary *) solarHolidayHK -{ - if (!_solarHolidayHK) - _solarHolidayHK = @{@"0101":NSLocalizedString(@"元旦",""), - @"0214":NSLocalizedString(@"情人节",""), - @"0308":NSLocalizedString(@"妇女节",""), - @"0501":NSLocalizedString(@"劳动节",""), - @"0601":NSLocalizedString(@"儿童节",""), - @"0701":NSLocalizedString(@"特区紀念日", ""), - @"1001":NSLocalizedString(@"国庆节",""), - @"1225":NSLocalizedString(@"圣诞节","") - }; - return _solarHolidayHK; -} - -@end diff --git a/Example/SSLunarDate/SSHolidayManager.h b/Example/SSLunarDate/SSHolidayManager.h deleted file mode 100755 index 53df90c..0000000 --- a/Example/SSLunarDate/SSHolidayManager.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// SSHolidayManager.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-20. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import - -typedef enum { - SSHolidayRegionChina = 0, - SSHolidayRegionHongkong, - SSHolidayRegionTaiwan, - SSHolidayRegionUS, - SSHolidayRegionCanadia, - SSHolidayRegionUK, -} SSHolidayRegion; - -#define HOLIDAY_REGION_CHANGED_NOTICE @"SSHolidayRegionChanged" - - -// This class manage the solar holiday of selected region. -// Majoy of the holiday day is calc by some rules in WiKi, -// But for some unknow holiday, such as China off day, which will -// update every year, so this should be fetch from network. -@interface SSHolidayManager : NSObject - -- initWithRegion:(SSHolidayRegion) region; - -- (NSArray *) getHolidayListForDate:(NSDate *)date; - - -@end diff --git a/Example/SSLunarDate/SSHolidayManager.m b/Example/SSLunarDate/SSHolidayManager.m deleted file mode 100755 index 6699453..0000000 --- a/Example/SSLunarDate/SSHolidayManager.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// SSHolidayManager.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-20. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#import "SSHolidayManager.h" -#import "SSLunarDate.h" -#import "SSHolidayCountry.h" -#import "SSHolidayUK.h" -#import "SSHolidayTW.h" -#import "SSHolidayUS.h" -#import "SSHolidayChina.h" -#import "SSHolidayHK.h" -#import "SSHolidayCA.h" - -@interface SSHolidayManager () -{ - SSHolidayRegion _region; - SSHolidayCountry *_country; -} - -@property (readonly) SSHolidayCountry *country; -@end - -@implementation SSHolidayManager - -- (id) initWithRegion:(SSHolidayRegion)region -{ - self = [super init]; - if (self) { - _region = region; - _country = [self allocateHolidayAlgoByRegion:region]; - } - return self; -} - -- (SSHolidayCountry *) allocateHolidayAlgoByRegion:(SSHolidayRegion)r { - switch (r) { - case SSHolidayRegionChina: - return [[SSHolidayChina alloc] init]; - case SSHolidayRegionHongkong: - return [[SSHolidayHK alloc] init]; - case SSHolidayRegionTaiwan: - return [[SSHolidayTW alloc] init]; - case SSHolidayRegionUS: - return [[SSHolidayUS alloc] init]; - case SSHolidayRegionCanadia: - return [[SSHolidayCA alloc] init]; - case SSHolidayRegionUK: - return [[SSHolidayUK alloc] init]; - default: - NSAssert(false, @"should not be here"); - return [[SSHolidayChina alloc] init]; - } -} - - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ - return [_country getHolidayListForDate:date]; -} - - -@end diff --git a/Example/SSLunarDate/SSHolidayTW.h b/Example/SSLunarDate/SSHolidayTW.h deleted file mode 100755 index 120bccc..0000000 --- a/Example/SSLunarDate/SSHolidayTW.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SSHolidayTW.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" - -@interface SSHolidayTW : SSHolidayCountry - -- (NSArray *) getHolidayListForDate:(NSDate *)date; - - -@end diff --git a/Example/SSLunarDate/SSHolidayTW.m b/Example/SSLunarDate/SSHolidayTW.m deleted file mode 100755 index 852e9db..0000000 --- a/Example/SSLunarDate/SSHolidayTW.m +++ /dev/null @@ -1,53 +0,0 @@ -// -// SSHolidayTW.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayTW.h" -#import "SSLunarDate.h" - -@interface SSHolidayTW() -{ - NSDictionary *_solarHolidayTW; -} - -@property (readonly) NSDictionary *solarHolidayTW; - -@end - -@implementation SSHolidayTW - -- (NSDictionary *) solarHolidayTW -{ if (!_solarHolidayTW) - _solarHolidayTW = @{@"0101":NSLocalizedString(@"开国纪念日",""), - @"0214":NSLocalizedString(@"情人节",""), - @"0228":NSLocalizedString(@"和平纪念日",""), - @"0308":NSLocalizedString(@"妇女节",""), - @"0501":NSLocalizedString(@"劳动节",""), - @"0601":NSLocalizedString(@"儿童节",""), - @"0903":NSLocalizedString(@"军人节", ""), - @"1010":NSLocalizedString(@"中华民国国庆日",""), - @"1225":NSLocalizedString(@"圣诞节","") - }; - return _solarHolidayTW; -} - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ - NSMutableArray *result = [[NSMutableArray alloc] init]; - SSLunarDate *lunarDate = [[SSLunarDate alloc] initWithDate:date - calendar:self.calendar]; - NSString *lunar; - lunar = [lunarDate getLunarHolidayNameWithRegion:self.region]; - if (lunar != nil) - [result addObject:lunar]; - [result addObjectsFromArray: [SSHolidayCountry getHolidayListFromTable:date - calendar:self.calendar - dict:self.solarHolidayTW]]; - return result; -} - -@end diff --git a/Example/SSLunarDate/SSHolidayUK.h b/Example/SSLunarDate/SSHolidayUK.h deleted file mode 100755 index 4190ab8..0000000 --- a/Example/SSLunarDate/SSHolidayUK.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// SSHolidayUK.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" - -@interface SSHolidayUK : SSHolidayCountry -- (NSArray *) getHolidayListForDate:(NSDate *)date; - -@end diff --git a/Example/SSLunarDate/SSHolidayUK.m b/Example/SSLunarDate/SSHolidayUK.m deleted file mode 100755 index 80bab54..0000000 --- a/Example/SSLunarDate/SSHolidayUK.m +++ /dev/null @@ -1,97 +0,0 @@ -// -// SSHolidayUK.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayUK.h" - -@interface SSHolidayUK() -{ - NSDictionary *_fixedHoliday; - NSDictionary *_variableHoliday; - int _cachedYear; -} - -@property (readonly) NSDictionary *fixedHoliday; -@property (readonly) NSDictionary *variableHoliday; - -@end -@implementation SSHolidayUK - - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ -// 1. add table holiday -// 2. add selected wester holiday - NSMutableArray *result = [[NSMutableArray alloc] init]; - - [result addObjectsFromArray: [SSHolidayCountry getHolidayListFromTable:date - calendar:self.calendar - dict:[self fixedHoliday]]]; - - NSDateComponents *c = [self.calendar components:NSYearCalendarUnit fromDate:date]; - - NSAssert(c.year != 0, @"should not zero"); - if (_cachedYear != c.year) { - _cachedYear = (int)c.year; - _variableHoliday = nil; - } - - [result addObjectsFromArray:[SSHolidayCountry getHolidayListFromTable:date calendar:self.calendar dict:[self variableHoliday]]]; - return result; -} - -- (NSDictionary *) fixedHoliday -{ - if (!_fixedHoliday) - _fixedHoliday = @{@"0101":NSLocalizedString(@"New Year's Day",""), - @"0317":NSLocalizedString(@"St. Patrick's Day",""), - @"0712":NSLocalizedString(@"Orangeman's Day", ""), - @"1225":NSLocalizedString(@"Christmas Day","")}; - return _fixedHoliday; -} - -// 1. good Friday -// 2. easter Monday -// 3. may day bank holiday -// 4. spring bank holiday -// 5. last summary bank holiday -// 6. boxing day -- (NSDictionary *) variableHoliday -{ - if (_variableHoliday == nil) { - NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; - - NSDate *d; - - d = [self.west getGoodFriday:_cachedYear]; - [dict setObject:HOLIDAY_GOOD_FRIDAY forKey:[self convertDateIndex:d]]; - - d = [self.west getEaster:_cachedYear]; - [dict setObject:HOLIDAY_EASTER_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getEasterMonday:_cachedYear]; - [dict setObject:HOLIDAY_EASTER_MONDAY - forKey:[self convertDateIndex:d]]; - - d = [self.west getMayBankDay: _cachedYear]; - [dict setObject:HOLIDAY_MAY_BANK_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getSpringBankDay: _cachedYear]; - [dict setObject:HOLIDAY_SPRING_BANK_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getLateSummaryBankHoliday:_cachedYear]; - [dict setObject:HOLIDAY_LATE_SUMMERY_BANK_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getBoxingDay:_cachedYear]; - [dict setObject:HOLIDAY_BOXING_DAY forKey:[self convertDateIndex:d]]; - - _variableHoliday = dict; - } - - return _variableHoliday; -} -@end diff --git a/Example/SSLunarDate/SSHolidayUS.h b/Example/SSLunarDate/SSHolidayUS.h deleted file mode 100755 index dff58cb..0000000 --- a/Example/SSLunarDate/SSHolidayUS.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SSHolidayUS.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayCountry.h" - -@interface SSHolidayUS : SSHolidayCountry - -- (NSArray *) getHolidayListForDate:(NSDate *)date; - - -@end diff --git a/Example/SSLunarDate/SSHolidayUS.m b/Example/SSLunarDate/SSHolidayUS.m deleted file mode 100755 index fcd0bea..0000000 --- a/Example/SSLunarDate/SSHolidayUS.m +++ /dev/null @@ -1,102 +0,0 @@ -// -// SSHolidayUS.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-8-25. -// Copyright (c) 2013年 Jiejing Zhang. All rights reserved. -// - -#import "SSHolidayUS.h" -#import "SSLunarDateHoliday.h" -#import "SSHolidayWest.h" - -@interface SSHolidayUS() -{ - NSDictionary *_solarHolidayUS; - NSDictionary *_variableHoliday; - int _cachedYear; -} - -@property (readonly) NSDictionary *solarHolidayUS; -@property (readonly) NSDictionary *variableHoliday; - -@end - -@implementation SSHolidayUS - -- (NSArray *) getHolidayListForDate:(NSDate *)date -{ -// 1. add table holiday -// 2. add selected wester holiday - NSMutableArray *result = [[NSMutableArray alloc] init]; - - [result addObjectsFromArray: [SSHolidayCountry getHolidayListFromTable:date - calendar:self.calendar - dict:[self solarHolidayUS]]]; - - NSDateComponents *c = [self.calendar components:NSYearCalendarUnit fromDate:date]; - - if (_cachedYear != c.year) { - _cachedYear = (int)c.year; - _variableHoliday = nil; - } - - [result addObjectsFromArray:[SSHolidayCountry getHolidayListFromTable:date calendar:self.calendar dict:[self variableHoliday]]]; - return result; -} - - - --(NSDictionary *) variableHoliday { - if (_variableHoliday == nil) { - NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; - - NSDate *d; - -// FIXME: I really don't happy with these code, should be more table -// way, but I don't want setup a function pointer in Obj-c. - - d = [self.west getGoodFriday:_cachedYear]; - [dict setObject:HOLIDAY_GOOD_FRIDAY forKey:[self convertDateIndex:d]]; - - d = [self.west getEaster:_cachedYear]; - [dict setObject:HOLIDAY_EASTER_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getMartinLutherKingBirthday:_cachedYear]; - [dict setObject:HOLIDAY_MLK_BIRTHDAY forKey:[self convertDateIndex:d]]; - d = [self.west getMemorialDay:_cachedYear]; - [dict setObject:HOLIDAY_MEM_DAY forKey:[self convertDateIndex:d]]; - d = [self.west getLaborDay:_cachedYear]; - [dict setObject:HOLIDAY_LABOR_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getColumbusDay:_cachedYear]; - [dict setObject:HOLIDAY_COLUMBUS_DAY forKey:[self convertDateIndex:d]]; - - d = [self.west getThanksGivingDay:_cachedYear]; - [dict setObject:HOLIDAY_THANKS_DAY forKey:[self convertDateIndex:d]]; - - _variableHoliday = dict; - } - - return _variableHoliday; -} - - -// 1. Third Monday in January, Birthday of Dr. Martin Luther King, Jr. -// 2. 2月的第三個星期一, Washington's Birthday/Presidents' Day -// 3. Last Monday in May Memorial Day -// 4. First Monday in September Labor Day -// 5. Second Monday in October Columbus Day -// 6. 11月的第四個星期四 Thanksgiving Day -- (NSDictionary *) solarHolidayUS -{ if (!_solarHolidayUS) - _solarHolidayUS = @{@"0101":NSLocalizedString(@"New Year's Day",""), - @"0214":NSLocalizedString(@"Valentine",""), - @"0704":NSLocalizedString(@"Independence Day",""), - @"1111":NSLocalizedString(@"Veterans Day", ""), - @"1225":NSLocalizedString(@"Christmas Day","") - }; - return _solarHolidayUS; -} - -@end diff --git a/Example/SSLunarDate/SSHolidayWest.h b/Example/SSLunarDate/SSHolidayWest.h deleted file mode 100755 index 12d353f..0000000 --- a/Example/SSLunarDate/SSHolidayWest.h +++ /dev/null @@ -1,69 +0,0 @@ -// -// SSHolidayWest.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-21. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - - -#import - -// United Kingdom holiday -#define HOLIDAY_GOOD_FRIDAY NSLocalizedString(@"Good Friday","") -#define HOLIDAY_GOOD_FRIDAY_NEXT NSLocalizedString(@"The day following Good Friday","") -#define HOLIDAY_EASTER_DAY NSLocalizedString(@"Easter Day","") -#define HOLIDAY_EASTER_MONDAY NSLocalizedString(@"Easter Monday","") -#define HOLIDAY_MAY_BANK_DAY NSLocalizedString(@"May Day Bank Holiday", "") -#define HOLIDAY_SPRING_BANK_DAY NSLocalizedString(@"Spring Bank Holiday", "") -#define HOLIDAY_LATE_SUMMERY_BANK_DAY NSLocalizedString(@"Summer Bank Holiday","") -#define HOLIDAY_BOXING_DAY NSLocalizedString(@"Boxing Day","") - -// US Holiday -#define HOLIDAY_MLK_BIRTHDAY NSLocalizedString(@"Birthday of MLK", "") -#define HOLIDAY_MEM_DAY NSLocalizedString(@"Memorial Day", "") -#define HOLIDAY_LABOR_DAY NSLocalizedString(@"Labor Day", "") -#define HOLIDAY_COLUMBUS_DAY NSLocalizedString(@"Columbus Day", "") -#define HOLIDAY_THANKS_DAY NSLocalizedString(@"Thanksgiving Day", "") - -// CA Holiday -#define HOLIDAY_VICTORIA_DAY NSLocalizedString(@"Victoria Day", "") - -@interface SSHolidayWest : NSObject -{ - NSCalendar *currentCalendar; -} -- (id) initWithCalendar:(NSCalendar *) calendar; -- (NSDate *) getEaster: (int) year; -- (NSDate *) getEasterMonday: (int) year; -- (NSDate *) getGoodFriday: (int) year; -- (NSDate *) getGoodFridayNextDay: (int) year; -- (NSDate *) getMartinLutherKingBirthday: (int) year; -- (NSDate *) getPresidentsDay: (int) year; -- (NSDate *) getMemorialDay: (int) year; -- (NSDate *) getLaborDay: (int) year; -- (NSDate *) getColumbusDay: (int) year; -- (NSDate *) getThanksGivingDay: (int) year; - -- (NSDate *) getMayBankDay: (int) year; -- (NSDate *) getSpringBankDay: (int) year; -- (NSDate *) getLateSummaryBankHoliday: (int) year; -- (NSDate *) getBoxingDay: (int) year; - -- (NSDate *) getVictoriaDay: (int) year; - -@end diff --git a/Example/SSLunarDate/SSHolidayWest.m b/Example/SSLunarDate/SSHolidayWest.m deleted file mode 100755 index 9adf9cd..0000000 --- a/Example/SSLunarDate/SSHolidayWest.m +++ /dev/null @@ -1,298 +0,0 @@ - -// -// SSHolidayWest.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-21. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -// The Easter algorithm is from -// HTTP://www.codeproject.com/Articles/1595/Calculating-Easter-Sunday - - -#import "SSHolidayWest.h" - -@implementation SSHolidayWest -// TODO: need implement a cache with current year. - -- (id) initWithCalendar:(NSCalendar *)calendar -{ - self = [super init]; - if (self) { - currentCalendar = calendar; - } - return self; -} - -- (NSDate *) getDateFromYear:(int) year month: (int) month day: (int) day -{ - unsigned int flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; - NSCalendar *cal = currentCalendar; - NSDateComponents *parts = [cal components:flags - fromDate:[NSDate date]]; - [parts setYear:year]; - [parts setMonth:month]; - [parts setDay:day]; - - return [cal dateFromComponents:parts]; -} - -- (NSDate *) getEasterMonday: (int) year -{ - - // good Friday is two day before easter day - NSDate *easterDay = [self getEaster:year]; - NSDateComponents *c = [[NSDateComponents alloc] init]; - c.day = 1; - - return [currentCalendar - dateByAddingComponents:c toDate:easterDay options:0]; -} - -// calculate easter sunday -- (NSDate *) getEaster: (int) year -{ - int correction = 0; - - int day, month; - - if (year < 1700) correction = 4; - else if (year < 1800) correction = 5; - else if (year < 1900) correction = 6; - else if (year < 2100) correction = 0; - else if (year < 2200) correction = 1; - else if (year < 2300) correction = 2; - else if (year < 2500) correction = 3; - - day = (19 * (year % 19) + 24) % 30; - day = 22 + day + ((2 * (year % 4) + 4 * (year % 7) + 6 * day + 5 + correction) % 7); - - // jump to next month - if (day > 31) { - month = 4; - day -= 31; - } else { - month = 3; - } - - // compose to a NSDate... - return [self getDateFromYear:year month:month day:day]; -} - -- (NSDate *) getGoodFriday: (int) year -{ - // good Friday is two day before easter day - NSDate *easterDay = [self getEaster:year]; - NSDateComponents *c = [[NSDateComponents alloc] init]; - c.day = -2; - - return [currentCalendar - dateByAddingComponents:c toDate:easterDay options:0]; -} - -- (NSDate *) getGoodFridayNextDay: (int) year -{ - // one day after good Friday - NSDate *easterDay = [self getEaster:year]; - NSDateComponents *c = [[NSDateComponents alloc] init]; - c.day = -1; - - return [currentCalendar - dateByAddingComponents:c toDate:easterDay options:0]; - -} - -// Third Monday in January, Birthday of Dr. Martin Luther King, Jr. -- (NSDate *) getMartinLutherKingBirthday: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 1; - c.weekdayOrdinal = 3; // third week - c.weekday = 2; // Monday - c.year = year; - - return [calendar dateFromComponents:c]; -} - -// Third Monday in Feb -- (NSDate *) getPresidentsDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 2; - c.weekdayOrdinal = 3; // third week - c.weekday = 2; // Monday - c.year = year; - - return [calendar dateFromComponents:c]; -} - -// Last Monday in May Memorial Day -- (NSDate *) getMemorialDay: (int) year -{ - NSCalendar* calendar = currentCalendar; - NSDateComponents* firstMondayInJuneComponents = [NSDateComponents new] ; - firstMondayInJuneComponents.month = 6 ; - firstMondayInJuneComponents.weekdayOrdinal = 1 ; - firstMondayInJuneComponents.weekday = 2 ; //Monday - firstMondayInJuneComponents.year = year; - NSDate* firstMondayInJune = [calendar - dateFromComponents:firstMondayInJuneComponents] ; -// --> 2012-06-04 - - NSDateComponents* subtractAWeekComponents = [NSDateComponents new] ; - subtractAWeekComponents.weekOfYear = -1 ; - NSDate* memorialDay = [calendar dateByAddingComponents:subtractAWeekComponents - toDate:firstMondayInJune options:0] ; -// --> 2012-05-28 - return memorialDay; -} - -// First Monday in Septembe Labor Day -- (NSDate *) getLaborDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 9; - c.weekdayOrdinal = 1; - c.weekday = 2; // Monday - c.year = year; - - return [calendar dateFromComponents:c]; -} - -// Second Monday in October Columbus Day -- (NSDate *) getColumbusDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 10; - c.weekdayOrdinal = 2; - c.weekday = 2; // Monday - c.year = year; - - return [calendar dateFromComponents:c]; -} - -// Fourth Thursday in November -- (NSDate *) getThanksGivingDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 11; - c.weekdayOrdinal = 4; - c.weekday = 5; - c.year = year; - - return [calendar dateFromComponents:c]; -} - - -// 1st Monday in May -- (NSDate *) getMayBankDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 5; - c.weekdayOrdinal = 1; // 1st - c.weekday = 2; // Monday - c.year = year; - - return [calendar dateFromComponents:c]; -} - -// last Monday in may -- (NSDate *) getSpringBankDay: (int) year -{ - return [self getMemorialDay:year]; -} - - -// last Monday in August -- (NSDate *) getLateSummaryBankHoliday: (int) year -{ - - NSCalendar* calendar = currentCalendar; - NSDateComponents* firstMondayNextMonthComponents = [NSDateComponents new] ; - firstMondayNextMonthComponents.month = 9 ; - firstMondayNextMonthComponents.weekdayOrdinal = 1 ; - firstMondayNextMonthComponents.weekday = 2 ; //Monday - firstMondayNextMonthComponents.year = year; - NSDate* firstMondayNextMonth = [calendar - dateFromComponents:firstMondayNextMonthComponents] ; -// - - NSDateComponents* subtractAWeekComponents = [NSDateComponents new] ; - subtractAWeekComponents.weekOfYear = -1 ; - NSDate* day = [calendar dateByAddingComponents:subtractAWeekComponents - toDate:firstMondayNextMonth options:0] ; - return day; - -} - -- (NSDate *) getBoxingDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 12; - c.day = 26; - c.year = year; - - NSDate *d = [calendar dateFromComponents:c]; - NSDateComponents *cc = [calendar components:NSCalendarUnitWeekday fromDate:d]; - if (cc.weekday == 1) {// if sunday, move to next monday - c.day = 27; - return [calendar dateFromComponents:c]; - } else - return d; -} - -// Last Monday before 5/25 -- (NSDate *) getVictoriaDay: (int) year -{ - NSCalendar *calendar = currentCalendar; - NSDateComponents *c = [[NSDateComponents alloc] init]; - - c.month = 5; - c.day = 24; - c.year = year; - NSDate *may24 = [calendar dateFromComponents:c]; - NSDateComponents *cc = [calendar components:NSCalendarUnitWeekday fromDate:may24]; - - // if that day was monday, it equal to zero. - // if that day was tue, it equal to 1, minor 1 = - NSDateComponents *ccc = [NSDateComponents new]; - int reminder = (int)cc.weekday - 2; - if (reminder >= 0) - ccc.day = - (cc.weekday - 2); - else - ccc.day = -6; // only happen when 24 is sunday. - - return [calendar dateByAddingComponents:ccc toDate:may24 options:0]; -} - -@end - diff --git a/Example/SSLunarDate/SSLunarDate-Prefix.pch b/Example/SSLunarDate/SSLunarDate-Prefix.pch deleted file mode 100755 index e3623af..0000000 --- a/Example/SSLunarDate/SSLunarDate-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'SSLunarDate' target in the 'SSLunarDate' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/Example/SSLunarDate/SSLunarDate.h b/Example/SSLunarDate/SSLunarDate.h deleted file mode 100755 index 5a2edca..0000000 --- a/Example/SSLunarDate/SSLunarDate.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// SSLunarDate.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-6. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import - -#import "SSLunarDateFormatter.h" -#import "SSLunarDateType.h" -#import "SSHolidayManager.h" - -@interface SSLunarDate : NSObject - -// init the solar date by [NSDate date]; -- (id) init; - -// init with solarDate -- (id) initWithDate:(NSDate *) solarDate; - -// This with date and calendar. -// The calendar is because the calendar generate function is very heavy, -// so better can use a parameter to have the calendar. -- (id) initWithDate:(NSDate *)solarDate calendar:(NSCalendar *)calendar; - -// Check whether the solar to lunar success or not, since the lunar convert -// have some range, the out ranged date will lead to empty string for the -// string functions. -- (BOOL) convertSuccess; -- (NSString *) monthString; -- (NSString *) dayString; -- (NSString *) zodiacString; -- (NSString *) string; -- (NSString *) yearGanzhiString; - -- (BOOL) isLeapMonth; // return whether the date is a leap month. -- (NSString *) leapString; - - -- (BOOL) isLunarHolidayWithRegion:(SSHolidayRegion) region; -- (NSString *) getLunarHolidayNameWithRegion:(SSHolidayRegion) region; - -// needs: 1. needs get the lunar date by a lunar date. -// 2. can get the string of date, to show on the calendar. -// 3. can show lunar holiday on the calendar. -// 4. the string must be i18n able, this is important for Hongko, Taiwan customer. - - -@end diff --git a/Example/SSLunarDate/SSLunarDate.m b/Example/SSLunarDate/SSLunarDate.m deleted file mode 100755 index 5d1f898..0000000 --- a/Example/SSLunarDate/SSLunarDate.m +++ /dev/null @@ -1,180 +0,0 @@ -// -// SSLunarDate.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-6. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import "SSLunarDate.h" -#import "libLunar.h" -#import "SSLunarDateHoliday.h" - -@interface SSLunarDate() -{ - BOOL dateOutOfRange; - NSCalendar *_calendar; - NSDate *_solarDate; - SSLunarDateFormatter *_formater; - LibLunarContext *_ctx; - SSLunarSimpleDate _simpleSolarDate; -} -@end - -@implementation SSLunarDate - - -- (id) init -{ - self = [super init]; - if (self) { - [self setupAndDoConvert:[NSDate date] - calendar:[NSCalendar currentCalendar]]; - } - - return self; -} - -- (void) dealloc -{ - // not call [supoer dealloc] since ARC already provide this. - freeLunarContext(_ctx); - _ctx = NULL; -} - -- (id) initWithDate:(NSDate *) solarDate -{ - self = [super init]; - if (self) { - [self setupAndDoConvert:solarDate - calendar:[NSCalendar currentCalendar]]; - } - return self; -} - -- (id) initWithDate:(NSDate *)solarDate calendar:(NSCalendar *)calendar -{ - self = [super init]; - if (self) { - [self setupAndDoConvert:solarDate calendar:calendar]; - } - - return self; -} - -- (void) setupAndDoConvert:(NSDate *) solarDate calendar:(NSCalendar *) cal -{ - _calendar = cal; - _formater = [SSLunarDateFormatter sharedLunarDateFormatter]; - [self NSDataToLunarDate:solarDate withDate:&_simpleSolarDate]; - - // NSLog(@"solarDate:%d %d", _simpleSolarDate.month, _simpleSolarDate.day); - - if (libLunarCheckYearRange(_simpleSolarDate.year) == false) { - dateOutOfRange = TRUE; - } - - NSAssert(_ctx == NULL, - @"libLunar Context was not null when setup, leak..."); - _ctx = createLunarContext(); - NSAssert(_ctx != NULL, @"create context failed"); - Solar2Lunar(_ctx, &_simpleSolarDate); -} - -#define RETURN_EMPTY_IF_DATE_OUT_OF_RANGE do { if (dateOutOfRange) return @""; } while (0) -#define RETURN_NO_IF_DATE_OUT_OF_RANGE do { if (dateOutOfRange) return FALSE; } while (0) - -- (BOOL) convertSuccess -{ - return !dateOutOfRange; -} - -- (NSString *) monthString -{ - NSAssert(_formater, @"formatter is null!"); - RETURN_EMPTY_IF_DATE_OUT_OF_RANGE; - return [_formater getLunarMonthForDate:_ctx]; -} - -- (NSString *) dayString -{ - NSAssert(_formater, @"formatter is null"); - RETURN_EMPTY_IF_DATE_OUT_OF_RANGE; - return [_formater getDayNameForDate:_ctx]; -} - -- (NSString *) zodiacString -{ - NSAssert(_formater, @"formatter is null"); - RETURN_EMPTY_IF_DATE_OUT_OF_RANGE; - return [_formater getShengXiaoNameForDate:_ctx]; -} - -- (NSString *) leapString -{ - RETURN_EMPTY_IF_DATE_OUT_OF_RANGE; - return [_formater getLeapString]; -} - -- (NSString *) yearGanzhiString -{ - NSAssert(_formater, @"formatter is null"); - RETURN_EMPTY_IF_DATE_OUT_OF_RANGE; - return [_formater getGanZhiYearNameForDate:_ctx]; -} - -- (NSString *) string -{ - NSAssert(_formater, @"formatter is null"); - RETURN_EMPTY_IF_DATE_OUT_OF_RANGE; - return [_formater getFullLunarStringForDate:_ctx]; -} - -- (BOOL) isLeapMonth -{ - NSAssert(_formater, @"formatter is null"); - RETURN_NO_IF_DATE_OUT_OF_RANGE; - return [_formater isLeapMonthForDate:_ctx]; -} - -- (void) NSDataToLunarDate:(NSDate *) date withDate:(SSLunarSimpleDate *) lunarDate -{ - unsigned int flags = NSYearCalendarUnit \ - | NSMonthCalendarUnit | NSDayCalendarUnit \ - | NSHourCalendarUnit; - NSDateComponents *parts = [_calendar components:flags fromDate:date]; - - lunarDate->year = (int)parts.year; - lunarDate->month = (int)parts.month; - lunarDate->day = (int)parts.day; - lunarDate->hour = (int)parts.hour; -} - -- (BOOL) isLunarHolidayWithRegion:(SSHolidayRegion) region -{ - SSLunarDateHoliday *holiday = [SSLunarDateHoliday sharedSSLunarDateHoliday]; - - return [holiday isDateLunarHoliday:_ctx region:region]; -} - -- (NSString *) getLunarHolidayNameWithRegion:(SSHolidayRegion) region -{ - SSLunarDateHoliday *holiday = [SSLunarDateHoliday sharedSSLunarDateHoliday]; - return [holiday getLunarHolidayNameForDate:_ctx region:region]; -} - -@end diff --git a/Example/SSLunarDate/SSLunarDateFormatter.h b/Example/SSLunarDate/SSLunarDateFormatter.h deleted file mode 100755 index 4b1e374..0000000 --- a/Example/SSLunarDate/SSLunarDateFormatter.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// SSLunarDateFormatter.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-7. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import -#import "SSLunarDate.h" -#import "libLunar.h" - -@interface SSLunarDateFormatter : NSObject - -+ (SSLunarDateFormatter *)sharedLunarDateFormatter; - -- (NSString *) getGanZhiNameForDate:(LibLunarContext *)lunar; - -- (NSString *) getShengXiaoNameForDate:(LibLunarContext *)lunar; - -- (NSString *) getGanZhiYearNameForDate:(LibLunarContext *)lunar; - -- (NSString *) getLunarMonthForDate: (LibLunarContext *) lunar; - -- (NSString *) getDayNameForDate: (LibLunarContext *) lunar; - -- (NSString *) getFullLunarStringForDate: (LibLunarContext *) lunar; - -- (BOOL) isLeapMonthForDate: (LibLunarContext *) lunar; - -- (NSString *) getLeapString; - -@end diff --git a/Example/SSLunarDate/SSLunarDateFormatter.m b/Example/SSLunarDate/SSLunarDateFormatter.m deleted file mode 100755 index 73ca8be..0000000 --- a/Example/SSLunarDate/SSLunarDateFormatter.m +++ /dev/null @@ -1,277 +0,0 @@ -// -// SSLunarDateFormatter.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-7. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import "SSLunarDateFormatter.h" - -#define YEAR_STR NSLocalizedString(@"年", "year") -#define LEAP_STR NSLocalizedString(@"闰", "leap") - -@interface SSLunarDateFormatter() -{ - NSArray *_monthArray; - NSArray *_dayArray; - NSArray *_ganArray; - NSArray *_zhiArray; - NSArray *_zodiacArray; - NSArray *_solarTerm; -} -@end - - -static SSLunarDateFormatter *_sharedFormatter = NULL; - -@implementation SSLunarDateFormatter - -+ (SSLunarDateFormatter *)sharedLunarDateFormatter -{ - @synchronized([SSLunarDateFormatter class]) { - if (!_sharedFormatter) - _sharedFormatter = [[self alloc] init]; - return _sharedFormatter; - } - return nil; -} - -+ (id) alloc -{ - @synchronized([SSLunarDateFormatter class]) { - NSAssert(_sharedFormatter == NULL, @"attempt to alloc a second SharedLunarDateFormatter"); - _sharedFormatter = [super alloc]; - return _sharedFormatter; - } - return nil; -} - -- (NSArray *) monthArray -{ - if (!_monthArray) - _monthArray = @[ - NSLocalizedString(@"正月",""), - NSLocalizedString(@"二月",""), - NSLocalizedString(@"三月",""), - NSLocalizedString(@"四月",""), - NSLocalizedString(@"五月",""), - NSLocalizedString(@"六月",""), - NSLocalizedString(@"七月",""), - NSLocalizedString(@"八月",""), - NSLocalizedString(@"九月",""), - NSLocalizedString(@"十月",""), - NSLocalizedString(@"十一月",""), - NSLocalizedString(@"腊月","")]; - - return _monthArray; -} - -- (NSArray *) dayArray -{ - if (!_dayArray) - _dayArray = @[ - NSLocalizedString(@"初一",""), - NSLocalizedString(@"初二",""), - NSLocalizedString(@"初三",""), - NSLocalizedString(@"初四",""), - NSLocalizedString(@"初五",""), - NSLocalizedString(@"初六",""), - NSLocalizedString(@"初七",""), - NSLocalizedString(@"初八",""), - NSLocalizedString(@"初九",""), - NSLocalizedString(@"初十",""), - NSLocalizedString(@"十一",""), - NSLocalizedString(@"十二",""), - NSLocalizedString(@"十三",""), - NSLocalizedString(@"十四",""), - NSLocalizedString(@"十五",""), - NSLocalizedString(@"十六",""), - NSLocalizedString(@"十七",""), - NSLocalizedString(@"十八",""), - NSLocalizedString(@"十九",""), - NSLocalizedString(@"二十",""), - NSLocalizedString(@"廿一",""), - NSLocalizedString(@"廿二",""), - NSLocalizedString(@"廿三",""), - NSLocalizedString(@"廿四",""), - NSLocalizedString(@"廿五",""), - NSLocalizedString(@"廿六",""), - NSLocalizedString(@"廿七",""), - NSLocalizedString(@"廿八",""), - NSLocalizedString(@"廿九",""), - NSLocalizedString(@"三十","")]; - - return _dayArray; -} - -- (NSArray *) ganArray -{ - if (!_ganArray) - _ganArray = @[ - NSLocalizedString(@"甲",""), - NSLocalizedString(@"乙",""), - NSLocalizedString(@"丙",""), - NSLocalizedString(@"丁",""), - NSLocalizedString(@"戊",""), - NSLocalizedString(@"己",""), - NSLocalizedString(@"庚",""), - NSLocalizedString(@"辛",""), - NSLocalizedString(@"壬",""), - NSLocalizedString(@"癸","")]; - return _ganArray; -} - -- (NSArray *) zhiArray -{ - if (!_zhiArray) - _zhiArray = @[ - NSLocalizedString(@"子",""), - NSLocalizedString(@"丑",""), - NSLocalizedString(@"寅",""), - NSLocalizedString(@"卯",""), - NSLocalizedString(@"辰",""), - NSLocalizedString(@"巳",""), - NSLocalizedString(@"午",""), - NSLocalizedString(@"未",""), - NSLocalizedString(@"申",""), - NSLocalizedString(@"酉",""), - NSLocalizedString(@"戌",""), - NSLocalizedString(@"亥","")]; - return _zhiArray; -} - -- (NSArray *) zodiacArray -{ - if (!_zodiacArray) - _zodiacArray = @[ - NSLocalizedString(@"鼠",""), - NSLocalizedString(@"牛",""), - NSLocalizedString(@"虎",""), - NSLocalizedString(@"兔",""), - NSLocalizedString(@"龙",""), - NSLocalizedString(@"蛇",""), - NSLocalizedString(@"马",""), - NSLocalizedString(@"羊",""), - NSLocalizedString(@"猴",""), - NSLocalizedString(@"鸡",""), - NSLocalizedString(@"狗",""), - NSLocalizedString(@"猪","")]; - return _zodiacArray; -} - -- (NSArray *) solarTerm -{ - if (!_solarTerm) - _solarTerm = @[ - NSLocalizedString(@"立春",""), - NSLocalizedString(@"雨水",""), - NSLocalizedString(@"清明",""), - NSLocalizedString(@"春分",""), - NSLocalizedString(@"惊蛰",""), - NSLocalizedString(@"谷雨",""), - NSLocalizedString(@"立夏",""), - NSLocalizedString(@"小满",""), - NSLocalizedString(@"芒种",""), - NSLocalizedString(@"夏至",""), - NSLocalizedString(@"小暑",""), - NSLocalizedString(@"大暑",""), - NSLocalizedString(@"立秋",""), - NSLocalizedString(@"处暑",""), - NSLocalizedString(@"白露",""), - NSLocalizedString(@"秋分",""), - NSLocalizedString(@"寒露",""), - NSLocalizedString(@"霜降",""), - NSLocalizedString(@"立冬",""), - NSLocalizedString(@"小雪",""), - NSLocalizedString(@"大雪",""), - NSLocalizedString(@"冬至",""), - NSLocalizedString(@"小寒",""), - NSLocalizedString(@"大寒","")]; - - return _solarTerm; -} - - - - -- (NSString *) getGanZhiNameForDate:(LibLunarContext *)lunar -{ - NSAssert(lunar != NULL, @"lunar not be null"); - - return [NSString stringWithFormat:@"%@%@", - [self ganArray][lunar->_gan.year], - [self zhiArray][lunar->_zhi.year]]; -} - -- (NSString *) getGanZhiYearNameForDate:(LibLunarContext *)lunar -{ - NSAssert(lunar != NULL, @"lunar not be null"); - - return [NSString stringWithFormat:@"%@%@%@", - [self ganArray][lunar->_gan.year], - [self zhiArray][lunar->_zhi.year], - YEAR_STR]; -} - -- (NSString *) getShengXiaoNameForDate:(LibLunarContext *)lunar -{ - NSAssert(lunar != NULL, @"lunar should not null"); - return [self zodiacArray][lunar->_zhi.year]; -} - -- (NSString *) getLunarMonthForDate: (LibLunarContext *) lunar -{ - NSAssert(lunar != NULL, @"lunar should not null"); - - NSString *monthStr = [self monthArray][lunar->_lunar.month - 1]; - if ([self isLeapMonthForDate:lunar]) { - return [NSString stringWithFormat:@"%@%@", - LEAP_STR, - monthStr]; - } else - return monthStr; -} - -- (NSString *) getDayNameForDate: (LibLunarContext *) lunar -{ - NSAssert(lunar != NULL, @"lunar should not null"); - return [self dayArray][lunar->_lunar.day - 1]; -} - -- (NSString *) getFullLunarStringForDate: (LibLunarContext *) lunar -{ - NSAssert(lunar != NULL, @"lunar should not null"); - - return [NSString stringWithFormat:@"%@%@%@%@", [self getGanZhiNameForDate:lunar], - YEAR_STR, [self getLunarMonthForDate:lunar], - [self getDayNameForDate:lunar] ]; - -} - -- (NSString *) getLeapString -{ - return LEAP_STR; -} - -- (BOOL) isLeapMonthForDate: (LibLunarContext *) lunar -{ - NSAssert(lunar != NULL, @"lunar should not null"); - return lunar->_lunar.leap == 1; -} - -@end diff --git a/Example/SSLunarDate/SSLunarDateHoliday.h b/Example/SSLunarDate/SSLunarDateHoliday.h deleted file mode 100755 index e2c6497..0000000 --- a/Example/SSLunarDate/SSLunarDateHoliday.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// SSLunarDateHoliday.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-20. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import - -#import "SSLunarDate.h" -#import "SSHolidayManager.h" -#import "libLunar.h" - - - -@interface SSLunarDateHoliday : NSObject - -+(id) sharedSSLunarDateHoliday; - -- (NSString *) getQingmingDate: (int) solarYear; - -- (NSString *) getDongzhiDate: (int) solarYear; - -- (BOOL) isDateLunarHoliday:(LibLunarContext *) lunar region:(SSHolidayRegion) region; - -- (NSString *) getLunarHolidayNameForDate: (LibLunarContext *) lunar region:(SSHolidayRegion) region; - -+ (NSString *) convertIndexFrom:(int) month day: (int) day; - -@end diff --git a/Example/SSLunarDate/SSLunarDateHoliday.m b/Example/SSLunarDate/SSLunarDateHoliday.m deleted file mode 100755 index e374c7d..0000000 --- a/Example/SSLunarDate/SSLunarDateHoliday.m +++ /dev/null @@ -1,199 +0,0 @@ -// -// SSLunarDateHoliday.m -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-20. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#import "SSLunarDateHoliday.h" - -@interface SSLunarDateHoliday() -{ - NSDictionary *_lunarHoliday; -} -@end - -static SSLunarDateHoliday *_sslunarholiday = NULL; - - - -@implementation SSLunarDateHoliday - -+(id) sharedSSLunarDateHoliday -{ - @synchronized([SSLunarDateHoliday class]) { - if (!_sslunarholiday) - _sslunarholiday = [[self alloc] init]; - return _sslunarholiday; - } - return nil; -} - -+ (id)alloc -{ - @synchronized([SSLunarDateHoliday class]) { - NSAssert(_sslunarholiday == NULL, @"attempt second sslunarHoliday object"); - if (!_sslunarholiday) - _sslunarholiday = [super alloc]; - return _sslunarholiday; - } - return nil; -} - -#define QINGMING_STR NSLocalizedString(@"清明节","") - -- (NSDictionary *) lunarHolidayChina -{ - if (!_lunarHoliday) - _lunarHoliday = @{ - @"0101":NSLocalizedString(@"春节",""), - @"0115":NSLocalizedString(@"元宵节",""), - // Qing ming - @"0505":NSLocalizedString(@"端午节",""), - @"0707":NSLocalizedString(@"七夕",""), - @"0815":NSLocalizedString(@"中秋节",""), - @"0909":NSLocalizedString(@"重阳节",""), - // dong zhi - @"1208":NSLocalizedString(@"腊八",""), - @"1230":NSLocalizedString(@"除夕","") - - // FIXME: 2013's Chu Xi is error!!!! - }; - - return _lunarHoliday; -} - -+ (NSString *) getPaddingStringForInt:(int) n -{ - return [NSString stringWithFormat:@"%@%d", (n < 10 ? @"0" : @""), n]; -} - -// Note about qingming: -// http://blog.csdn.net/soft_newcoder/article/details/6127261 - -- (NSString *) getQingmingDate: (int) solarYear -{ - double c = 0.0f; - double d = 0.2422; - if (solarYear >= 1900 && solarYear <= 1999) - c = 5.59; - else if (solarYear >= 2000 && solarYear <= 2099) - c = 4.81; - else - return @""; - int date = ((solarYear % 100) * d + c ) - ((solarYear % 100) / 4); - - return [NSString stringWithFormat:@"040%d", date]; -} - -// Note about Dongzhi & Xiazhi -// http://www.360doc.com/content/10/0424/23/963854_24736431.shtml - - -#define DONGZHI_STR NSLocalizedString(@"冬至","") - -- (NSString *) getDongzhiDate: (int) solarYear -{ - double c = 0.0f; - double d = 0.2422; - if (solarYear >= 1900 && solarYear <= 1999) - c = 22.60f; - else if (solarYear >= 2000 && solarYear <= 2099) - c = 21.94; - else - return @""; - - int y = solarYear % 100; - int date = (y * d + c) - (y / 4); - - if (solarYear == 1918 || solarYear == 2021) - date -= 1; - return [NSString stringWithFormat:@"12%d", date]; -} - -+ (NSString *) convertIndexFrom:(int) month day: (int) day -{ - NSString *index; - index = [NSString stringWithFormat:@"%@%@", - [self.class getPaddingStringForInt:month], - [self.class getPaddingStringForInt:day]]; - return index; -} - -- (BOOL) isDateLunarHoliday:(LibLunarContext *) lunar region:(SSHolidayRegion) region -{ - NSAssert(lunar != NULL, @"lunar should not null"); - - NSString *index; - -// Leap month is not holiday... - if (lunar->_lunar.leap == 1) - return NO; - - index = [self.class convertIndexFrom:lunar->_lunar.month - day:lunar->_lunar.day]; - - if (region == SSHolidayRegionChina) - return [self isDateLunarHolidayChina:lunar index:index]; - - - - return NO; -} - -- (NSString *) getLunarHolidayNameForDate: (LibLunarContext *) lunar region:(SSHolidayRegion) region -{ - NSAssert(lunar != NULL, @"lunar should not null"); - if (![self isDateLunarHoliday:lunar region:region]) - return nil; - - NSString *index = [self.class convertIndexFrom:lunar->_lunar.month - day:lunar->_lunar.day]; - - if (region == SSHolidayRegionChina) - return [self getLunarHolidayNameForDateChina:lunar index:index]; - - return nil; -} - -- (BOOL) isDateLunarHolidayChina:(LibLunarContext *) lunar index:(NSString *)index -{ - if ([[self lunarHolidayChina] objectForKey:index] != nil) - return YES; - if ([index isEqualToString:[self getQingmingDate:lunar->_solar.year]]) - return YES; - if ([index isEqualToString:[self getDongzhiDate:lunar->_solar.year]]) - return YES; - return NO; -} - -- (NSString *) getLunarHolidayNameForDateChina:(LibLunarContext *)lunar index:(NSString *)index -{ - if ([index isEqualToString:[self getQingmingDate:lunar->_solar.year]]) - return QINGMING_STR; - if ([index isEqualToString:[self getDongzhiDate:lunar->_solar.year]]) - return DONGZHI_STR; - - NSString *name = [[self lunarHolidayChina] objectForKey:index]; - return name; -} - - - - -@end diff --git a/Example/SSLunarDate/SSLunarDateType.h b/Example/SSLunarDate/SSLunarDateType.h deleted file mode 100755 index dd57529..0000000 --- a/Example/SSLunarDate/SSLunarDateType.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// SSLunarDateType.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-7. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#ifndef SSLunarDate_SSLunarDateType_h -#define SSLunarDate_SSLunarDateType_h - -typedef struct { - int year, month, day, hour, weekday; - int leap; /* the lunar month is a leap month */ -} SSLunarSimpleDate; - -#define Cyear 1900 /* Note that LC1900.1.1 is SC1900.1.31 */ -#define Nyear 150 /* number of years covered by the table */ -#define Nmonth 13 /* maximum number of months in a lunar year */ - -typedef struct LibLunarContext { - SSLunarSimpleDate _solar; - SSLunarSimpleDate _lunar; - SSLunarSimpleDate _gan; - SSLunarSimpleDate _zhi; - SSLunarSimpleDate _gan2; - SSLunarSimpleDate _zhi2; - SSLunarSimpleDate _lunar2; - int _ymonth[Nyear]; - int _yday[Nyear]; - int _mday[Nmonth + 1]; - int _jieAlert; -} LibLunarContext; - -#endif diff --git a/Example/SSLunarDate/en.lproj/LunarDateFormatter.strings b/Example/SSLunarDate/en.lproj/LunarDateFormatter.strings deleted file mode 100755 index 57187570061d5ae8b3caa08097c752cbaa436ee9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13104 zcmchdPiPcZ9LHa=6%DqFhaMCIni2v5TW1pgQA!yTOkB*yoslGClEG};#E@h+*l8bMEm9y}C^7w;l;@#4jUQ0Sp0NTDgY3GMXv<~h9Yc=jt{m;KJ{=ELvz ze!t&)zc(-buR(pGTGdfiP*r&!mG^1+E31l{7d@k9<;tR(P}k(zHMvq!%kr-8kIU7H zd@9R#K9_5)@}C-1llq|0BdSV-jN(LM2v&t+ z70Y|W1&oY9@_a^WLRqRqDam;jcRdsPE;07kGZvl~t4b363rP;}a{Eq(sxywq`VnHK zTS&ZU`MUT=ZFSXVK&m-8&{2FeXjw+FNPm`*q!ovBxoA1Qj8#egCM4rnyvZWww(7vIC0&9Nk@2X{48Z=tVEt zE#q}q|Msm#IH#nVGpBsk|JyC3rJ6(gYrxLRzRV{T+L(P9Zj4!$Q5>6cA@(0eaY!xU zbLfVRVv*2$Er~B#q*r(CIJJaYaY)~Ub0J20syVbvFj7~D`!P>|qjw4Qem%>B&j;O2 zJ61+Z_!br~zX~iP_Ua{WG4Qa(9VNT_ScscdYu(c>pjPhOJFxM1Yk+r8Q znV)#s^g6my#Cnu!PE5Rx?!84bnnQ~t>{MOF>r~?iJ4Tn-F~$*gj4rWbj3ewAU1G-= zN7ymC#EvnJuw!(I9b+6}$LJC}#yG-`(Is|_afBVCOY9h*Tzy=?s+4L@o%r?Y&YG>b zMsY}oN3wRMnnPC@G$aeE51KxVCx zWZq)YPOopnj=oVGFW&pkM*o0#k@qy|XCUd*%*;9R!iKdflvM`r3F@*l8bMEm9y}C^7w;l;@#4jUQ0Sp0NTDgY3GMXv<~h9Yc=jt{m;KJ{=ELvz ze!t&)zc(-buR(pGTGdfiP*r&!mG^1+E31l{7d@k9<;tR(P}k(zHMvq!%kr-8kIU7H zd@9R#K9_5)@}C-1llq|0BdSV-jN(LM2v&t+ z70Y|W1&oY9@_a^WLRqRqDam;jcRdsPE;07kGZvl~t4b363rP;}a{Eq(sxywq`VnHK zTS&ZU`MUT=ZFSXVK&m-8&{2FeXjw+FNPm`*q!ovBxoA1Qj8#egCM4rnyvZWww(7vIC0&9Nk@2X{48Z=tVEt zE#q}q|Msm#IH#nVGpBsk|JyC3rJ6(gYrxLRzRV{T+L(P9Zj4!$Q5>6cA@(0eaY!xU zbLfVRVv*2$Er~B#q*r(CIJJaYaY)~Ub0J20syVbvFj7~D`!P>|qjw4Qem%>B&j;O2 zJ61+Z_!br~zX~iP_Ua{WG4Qa(9VNT_ScscdYu(c>pjPhOJFxM1Yk+r8Q znV)#s^g6my#Cnu!PE5Rx?!84bnnQ~t>{MOF>r~?iJ4Tn-F~$*gj4rWbj3ewAU1G-= zN7ymC#EvnJuw!(I9b+6}$LJC}#yG-`(Is|_afBVCOY9h*Tzy=?s+4L@o%r?Y&YG>b zMsY}oN3wRMnnPC@G$aeE51KxVCx zWZq)YPOopnj=oVGFW&pkM*o0#k@qy|XCUd*%*;9R!iKdflvM`r3F@ -#include -#include -#include -#include "libLunar.h" - -#define VALID_MIN_YEAR 1900 -#define VALID_MAX_YEAR 2049 - -static SSLunarSimpleDate SolarFirstDate = { - /* Wednesday, 12 a.m., 31 January, 1900 */ - 1900, 1, 31, 0, 3, 0 -}; - -static SSLunarSimpleDate LunarFirstDate = { - /* Wednesday, 12 a.m., First day, First month, 1900 */ - 1900, 1, 1, 0, 3, 0 -}; - -static SSLunarSimpleDate GanFirstDate = { - /* geng1-nian2 wu4-yue4 jia3-ri4 jia3-shi2 */ - 6, 4, 0, 0, 3, 0 -}; - -static SSLunarSimpleDate ZhiFirstDate = { - /* zi3-nian2 yin2-yue4 chen2-ri4 zi3-shi2 */ - 0, 2, 4, 0, 3, 0 -}; - -static long yearInfo[Nyear] = { - /* encoding: - b bbbbbbbbbbbb bbbb - bit# 1 111111000000 0000 - 6 543210987654 3210 - . ............ .... - month# 000000000111 - M 123456789012 L - - b_j = 1 for long month, b_j = 0 for short month - L is the leap month of the year if 1<=L<=12; NO leap month if L = 0. - The leap month (if exists) is long one iff M = 1. - */ - 0x04bd8, /* 1900 */ - 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, /* 1905 */ - 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, /* 1910 */ - 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, /* 1915 */ - 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, /* 1920 */ - 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, /* 1925 */ - 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, /* 1930 */ - 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, /* 1935 */ - 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, /* 1940 */ - 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, /* 1945 */ - 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, /* 1950 */ - 0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, /* 1955 */ - 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, /* 1960 */ - 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, /* 1965 */ - 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, /* 1970 */ - 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, /* 1975 */ - 0x0d558, 0x0b540, 0x0b5a0, 0x195a6, 0x095b0, /* 1980 */ - 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, /* 1985 */ - 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, /* 1990 */ - 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, /* 1995 */ - 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, 0x0c960, /* 2000 */ - 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, /* 2005 */ - 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, /* 2010 */ - 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, /* 2015 */ - 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, /* 2020 */ - 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, /* 2025 */ - 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, /* 2030 */ - 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, /* 2035 */ - 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, /* 2040 */ - 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, /* 2045 */ - 0x0aa50, 0x1b255, 0x06d20, 0x0ada0 /* 2049 */ -}; - -/* - In "4-column" calculation, a "mingli" (fortune-telling) calculation, - the beginning of a month is not the first day of the month as in - the Lunar Calendar; it is instead governed by "jie2" (festival). - Interestingly, in the Solar calendar, a jie always comes around certain - day. For example, the jie "li4chun1" (beginning of spring) always comes - near Feburary 4 of the Solar Calendar. - - Meaning of array fest: - Each element, fest[i][j] stores the jie day (in term of the following Solar - month) of the lunar i-th year, j-th month. - For example, in 1992, fest[92][0] is 4, that means the jie "li4chun1" - (beginning of spring) is on Feb. 4, 1992; fest[92][11] is 5, that means - the jie of the 12th lunar month is on Jan. 5, 1993. - */ - -typedef char byte; - -static byte fest[Nyear][12] = { - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1900 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1901 */ - {5, 6, 6, 6, 7, 8, 8, 8, 9, 8, 8, 6}, /* 1902 */ - {5, 7, 6, 7, 7, 8, 9, 9, 9, 8, 8, 7}, /* 1903 */ - {5, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1904 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1905 */ - {5, 6, 6, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1906 */ - {5, 7, 6, 7, 7, 8, 9, 9, 9, 8, 8, 7}, /* 1907 */ - {5, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1908 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1909 */ - {5, 6, 6, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1910 */ - {5, 7, 6, 7, 7, 8, 9, 9, 9, 8, 8, 7}, /* 1911 */ - {5, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1912 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1913 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1914 */ - {5, 6, 6, 6, 7, 8, 8, 9, 9, 8, 8, 6}, /* 1915 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1916 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 7, 6}, /* 1917 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1918 */ - {5, 6, 6, 6, 7, 8, 8, 9, 9, 8, 8, 6}, /* 1919 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1920 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 9, 7, 6}, /* 1921 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1922 */ - {5, 6, 6, 6, 7, 8, 8, 9, 9, 8, 8, 6}, /* 1923 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1924 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 7, 6}, /* 1925 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1926 */ - {5, 6, 6, 6, 7, 8, 8, 8, 9, 8, 8, 6}, /* 1927 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1928 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1929 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1930 */ - {5, 6, 6, 6, 7, 8, 8, 8, 9, 8, 8, 6}, /* 1931 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1932 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1933 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1934 */ - {5, 6, 6, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1935 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1936 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1937 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1938 */ - {5, 6, 6, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1939 */ - {5, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1940 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1941 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1942 */ - {5, 6, 6, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1943 */ - {5, 6, 5, 5, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1944 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1945 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1946 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1947 */ - {5, 5, 5, 5, 6, 7, 7, 8, 8, 7, 7, 5}, /* 1948 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1949 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1950 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1951 */ - {5, 5, 5, 5, 6, 7, 7, 8, 8, 7, 7, 5}, /* 1952 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1953 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 7, 6}, /* 1954 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1955 */ - {5, 5, 5, 5, 6, 7, 7, 8, 8, 7, 7, 5}, /* 1956 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1957 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1958 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1959 */ - {5, 5, 5, 5, 6, 7, 7, 7, 8, 7, 7, 5}, /* 1960 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1961 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1962 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1963 */ - {5, 5, 5, 5, 6, 7, 7, 7, 8, 7, 7, 5}, /* 1964 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1965 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1966 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1967 */ - {5, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1968 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1969 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1970 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1971 */ - {5, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1972 */ - {4, 6, 5, 5, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1973 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1974 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1975 */ - {5, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1976 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 1977 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1978 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1979 */ - {5, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1980 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 1981 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1982 */ - {4, 6, 5, 6, 6, 8, 8, 8, 9, 8, 8, 6}, /* 1983 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1984 */ - {5, 5, 5, 5, 5, 8, 7, 7, 8, 7, 7, 5}, /* 1985 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1986 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1987 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1988 */ - {5, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1989 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 1990 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1991 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1992 */ - {5, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1993 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1994 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1995 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1996 */ - {5, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 1997 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 1998 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 1999 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2000 */ - {4, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2001 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 2002 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 2003 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2004 */ - {4, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2005 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2006 */ - {4, 6, 5, 6, 6, 7, 8, 8, 9, 8, 7, 6}, /* 2007 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2008 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2009 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2010 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 2011 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2012 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2013 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2014 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 2015 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2016 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2017 */ - {4, 5, 5, 5, 6, 7, 7, 8, 8, 7, 7, 5}, /* 2018 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 2019 */ - {4, 5, 4, 5, 5, 6, 7, 7, 8, 7, 7, 5}, /* 2020 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2021 */ - {4, 5, 5, 5, 6, 7, 7, 7, 8, 7, 7, 5}, /* 2022 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 8, 7, 6}, /* 2023 */ - {4, 5, 4, 5, 5, 6, 7, 7, 8, 7, 6, 5}, /* 2024 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2025 */ - {4, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2026 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 2027 */ - {4, 5, 4, 5, 5, 6, 7, 7, 8, 7, 6, 5}, /* 2028 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2029 */ - {4, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2030 */ - {4, 6, 5, 6, 6, 7, 8, 8, 8, 7, 7, 6}, /* 2031 */ - {4, 5, 4, 5, 5, 6, 7, 7, 8, 7, 6, 5}, /* 2032 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2033 */ - {4, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2034 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2035 */ - {4, 5, 4, 5, 5, 6, 7, 7, 8, 7, 6, 5}, /* 2036 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2037 */ - {4, 5, 5, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2038 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2039 */ - {4, 5, 4, 5, 5, 6, 7, 7, 8, 7, 6, 5}, /* 2040 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2041 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2042 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2043 */ - {4, 5, 4, 5, 5, 6, 7, 7, 7, 7, 6, 5}, /* 2044 */ - {3, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2045 */ - {4, 5, 4, 5, 5, 7, 7, 7, 8, 7, 7, 5}, /* 2046 */ - {4, 6, 5, 5, 6, 7, 7, 8, 8, 7, 7, 6}, /* 2047 */ - {4, 5, 4, 5, 5, 6, 7, 7, 7, 7, 6, 5}, /* 2048 */ - {3, 5, 4, 5, 5, 6, 7, 7, 8, 7, 7, 5} /* 2049 */ -}; - -static const int daysInSolarMonth[13] = { - 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - -static int moon[2] = {29,30}; /* a short (long) lunar month has 29 (30) days */ - -#if 0 -static char *Gan[] = { - "Jia3", "Yi3", "Bing3", "Ding1", "Wu4", - "Ji3", "Geng1", "Xin1", "Ren2", "Gui3" -}; - -static char *Zhi[] = { - "Zi3", "Chou3", "Yin2", "Mao3", "Chen2", "Si4", - "Wu3", "Wei4", "Shen1", "You3", "Xu1", "Hai4" -}; - -static char *ShengXiao[] = { - "Mouse", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", - "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig" -}; - -static char *weekday[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday" -}; - -static char *GanGB[] = { - "甲", "乙", "丙", "丁", "戊", - "己", "庚", "辛", "壬", "癸" -}; - -static char *ZhiGB[] = { - "子", "丑", "寅", "卯", "辰", "巳", - "午", "未", "申", "酉", "戌", "亥" -}; - -static char *ShengXiaoGB[] = { - "鼠", "牛", "虎", "兔", "龙", "蛇", - "马", "羊", "猴", "鸡", "狗", "猪" -}; - -static char *weekdayGB[] = { - "日", "一", "二", "三", - "四", "五", "六" -}; -#endif - -//Date _solar, _lunar, gan, zhi, gan2, zhi2, _lunar2; - -//int ymonth[Nyear]; /* number of lunar months in the years */ -//int yday[Nyear]; /* number of lunar days in the years */ -//int mday[Nmonth+1]; /* number of days in the months of the lunar year */ -int jieAlert; /* if there is uncertainty in JieQi calculation */ - -int showHZ = 0; /* output in hanzi */ -char *progname; - - -long Solar2Day(SSLunarSimpleDate *d); -long Solar2Day1(SSLunarSimpleDate *d); -long Lunar2Day(LibLunarContext *ctx, SSLunarSimpleDate *d); - -void Day2Lunar(LibLunarContext *ctx, long offset); -void Day2Solar(LibLunarContext *ctx, long offset); - -int make_yday(LibLunarContext *ctx); -int make_mday(LibLunarContext *ctx, int year); -int GZcycle(); - -void CalGZ(); -int JieDate(), JieDate(); -void Report(SSLunarSimpleDate *, SSLunarSimpleDate *, SSLunarSimpleDate *), ReportE(); -void ReportGB(SSLunarSimpleDate *solar, SSLunarSimpleDate *lunar, SSLunarSimpleDate *lunar2); -void usage(), Error(); -int CmpDate(int month1, int day1, int month2, int day2); - -struct LibLunarContext * createLunarContext() -{ - struct LibLunarContext *ctx; - ctx = malloc(sizeof(struct LibLunarContext)); - if (ctx == NULL) - return NULL; - memset(ctx, 0, sizeof(*ctx)); - return ctx; -} - -void freeLunarContext(struct LibLunarContext *context) -{ - free(context); -} - -SSLunarSimpleDate *getSolarDate(LibLunarContext *ctx) -{ - if (ctx != NULL) - return &ctx->_solar; - return NULL; -} - -SSLunarSimpleDate *getLunarDate(LibLunarContext *ctx) -{ - if (ctx != NULL) - return &ctx->_lunar; - return NULL; -} - -int libLunarCheckYearRange(int year) -{ - if (year >= VALID_MIN_YEAR && year <= VALID_MAX_YEAR) - return 1; - else - return 0; -} - -void Solar2Lunar(struct LibLunarContext *ctx, - SSLunarSimpleDate *solar) -{ - - long offset; - - if (ctx == NULL) { - fprintf(stderr, "Soloar2Lunar: ctx pointer cannot be NULL"); - return; - } - - if (!libLunarCheckYearRange(solar->year)) { - fprintf(stderr, "Solar2Lunar: the year provide exceeds lib's ablility."); - return; - } - - - offset = Solar2Day(solar); - solar->weekday = (offset + SolarFirstDate.weekday) % 7; - - /* A lunar day begins at 11 p.m. */ - if (solar->hour == 23) - offset++; - - Day2Lunar(ctx, offset); - ctx->_lunar.hour = solar->hour; - CalGZ(offset, &ctx->_lunar, &ctx->_gan, &ctx->_zhi); - - jieAlert = JieDate(solar, &ctx->_lunar2); - ctx->_lunar2.day = ctx->_lunar.day; - ctx->_lunar2.hour = ctx->_lunar.hour; - CalGZ(offset, &ctx->_lunar2, &ctx->_gan2, &ctx->_zhi2); -} - - -void Lunar2Solar(struct LibLunarContext *ctx, SSLunarSimpleDate *lunar) -{ - long offset; - int adj; - - if (ctx == NULL) { - fprintf(stderr, "Lunar2Solar: ctx pointer cannot be NULL"); - return; - } - - /* A solar day begins at 12 a.m. */ - adj = (ctx->_lunar.hour == 23)? -1 : 0; - offset = Lunar2Day(ctx, &ctx->_lunar); - ctx->_solar.weekday = (offset+ adj + SolarFirstDate.weekday) % 7; - Day2Solar(ctx, offset + adj); - ctx->_solar.hour = lunar->hour; - CalGZ(offset, lunar, &ctx->_gan, &ctx->_zhi); - - jieAlert = JieDate(&ctx->_solar, &ctx->_lunar2); - ctx->_lunar2.day = lunar->day; - ctx->_lunar2.hour = lunar->hour; - CalGZ(offset, &ctx->_lunar2, &ctx->_gan2, &ctx->_zhi2); -} - - -#define LeapYear(y) (((y)%4==0) && ((y)%100!=0) || ((y)%400==0)) -#define BYEAR 1201 -/* BYEAR % 4 == 1 and BYEAR % 400 == 1 for easy calculation of leap years */ -/* assert(BYEAR <= SolarFirstDate.year) */ - -long Solar2Day(SSLunarSimpleDate *d) - -{ - return (Solar2Day1(d) - Solar2Day1(&SolarFirstDate)); -} - - -/* Compute the number of days from the Solar date BYEAR.1.1 */ -long Solar2Day1(SSLunarSimpleDate *d) -{ - long offset, delta; - int i; - - delta = d->year - BYEAR; - if (delta<0) Error("Internal error: pick a larger constant for BYEAR."); - offset = delta * 365 + delta / 4 - delta / 100 + delta / 400; - for (i=1; i< d->month; i++) - offset += daysInSolarMonth[i]; - if ((d->month > 2) && LeapYear(d->year)) - offset++; - offset += d->day - 1; - - if ((d->month == 2) && LeapYear(d->year)) - { - if (d->day > 29) Error("Day out of range."); - } - else if (d->day > daysInSolarMonth[d->month]) Error("Day out of range."); - return offset; -} - - -/* Compute offset days of a lunar date from the beginning of the table */ -long Lunar2Day(LibLunarContext *ctx, SSLunarSimpleDate *d) -{ - long offset = 0; - int year, i, m, leapMonth; - - year = d->year - LunarFirstDate.year; - for (i=0; i_yday[i]; - - leapMonth = make_mday(ctx, year); - if ((d->leap) && (leapMonth!=d->month)) - { - printf("%d is not a leap month in year %d.\n", d->month, d->year); - exit(1); - } - for (m=1; mmonth; m++) - offset += ctx->_mday[m]; - if (leapMonth && - ((d->month>leapMonth) || (d->leap && (d->month==leapMonth)))) - offset += ctx->_mday[m++]; - offset += d->day - 1; - - if (d->day > ctx->_mday[m]) Error("Day out of range."); - - return offset; -} - - -void Day2Lunar(LibLunarContext *ctx, - long offset) -{ - int i, m, nYear, leapMonth; - - SSLunarSimpleDate *d = &ctx->_lunar; - - nYear = make_yday(ctx); - for (i = 0; i < nYear && offset > 0; i++) - offset -= ctx->_yday[i]; - // reduce each year day, try to get which year of current year is. - - /* if the year less zero, means that year not really come year, */ - if (offset<0) - offset += ctx->_yday[--i]; - - if (i >= Nyear) Error("Year out of range."); - - /* so, the year is the current year + i */ - d->year = i + LunarFirstDate.year; - - leapMonth = make_mday(ctx, i); - for (m=1; m<=Nmonth && offset>0; m++) - offset -= ctx->_mday[m]; - - if (offset<0) - offset += ctx->_mday[--m]; - - d->leap = 0; /* don't know leap or not yet */ - - if (leapMonth>0) /* has leap month */ - { - /* if preceeding month number is the leap month, - this month is the actual extra leap month */ - d->leap = (leapMonth == (m - 1)); - - /* month > leapMonth is off by 1, so adjust it */ - if (m > leapMonth) --m; - } - - d->month = m; - d->day = (int)offset + 1; -} - - -void Day2Solar(LibLunarContext *ctx, - long offset) -{ - int i, m, days; - SSLunarSimpleDate *d = &ctx->_solar; - - /* offset is the number of days from SolarFirstDate */ - offset -= Solar2Day(&LunarFirstDate); /* the argument is negative */ - /* offset is now the number of days from SolarFirstDate.year.1.1 */ - - for (i=SolarFirstDate.year; - (i 0); i++) - offset -= 365 + LeapYear(i); - if (offset<0) - { - --i; /* LeapYear is a macro */ - offset += 365 + LeapYear(i); - } - if (i==(SolarFirstDate.year + Nyear)) Error("Year out of range."); - d->year = i; - - /* assert(offset<(365+LeapYear(i))); */ - for (m=1; m<=12; m++) - { - days = daysInSolarMonth[m]; - if ((m==2) && LeapYear(i)) /* leap February */ - days++; - if (offsetmonth = m; - d->day = (int)offset + 1; - return; - } - offset -= days; - } -} - - -int GZcycle(int g, int z) -{ - int gz; - - for (gz = z; gz % 10 != g && gz < 60; gz += 12) ; - if (gz >= 60) printf("internal error\n"); - return gz+1; -} - - -void CalGZ(long offset, SSLunarSimpleDate *d, SSLunarSimpleDate *g, SSLunarSimpleDate *z) -{ - int year, month; - - year = d->year - LunarFirstDate.year; - month = year * 12 + d->month - 1; /* leap months do not count */ - - g->year = (GanFirstDate.year + year) % 10; - z->year = (ZhiFirstDate.year + year) % 12; - g->month = (GanFirstDate.month + month) % 10; - z->month = (ZhiFirstDate.month + month) % 12; - g->day = (GanFirstDate.day + offset) % 10; - z->day = (ZhiFirstDate.day + offset) % 12; - z->hour = ((d->hour + 1) / 2) % 12; - g->hour = (g->day * 12 + z->hour) % 10; -} - - -void Error(s) -char *s; -{ - printf("libLunar:%s\n",s); - assert(-1); - // exit(1); -} - - -/* Compare two dates and return <,=,> 0 if the 1st is <,=,> the 2nd */ -int CmpDate(int month1, int day1,int month2,int day2) -{ - if (month1!=month2) return(month1-month2); - if (day1!=day2) return(day1-day2); - return(0); -} - - -/* - Given a solar date, find the "lunar" date for the purpose of - calculating the "4-columns" by taking jie into consideration. - */ -int JieDate(SSLunarSimpleDate *ds, SSLunarSimpleDate *dl) -{ - int m, flag = 0; - - if (ds->month==1) - { - flag = CmpDate(ds->month, ds->day, - 1, fest[ds->year - SolarFirstDate.year - 1][11]); - if (flag<0) dl->month = 11; - else if (flag>0) dl->month = 12; - dl->year = ds->year - 1; - return(flag==0); - } - for (m=2; m<=12; m++) - { - flag = CmpDate(ds->month, ds->day, - m, fest[ds->year - SolarFirstDate.year][m-2]); - if (flag==0) m++; - if (flag<=0) break; - } - dl->month = (m-2) % 12; - dl->year = ds->year; - if ((dl->month)==0) - { - dl->year = ds->year - 1; - dl->month = 12; - } - return(flag==0); -} - - -/* Compute the number of days in each lunar year in the table */ -int make_yday(LibLunarContext *ctx) -{ - int year, i, leap; - long code; - - for (year = 0; year < Nyear; year++) - { - code = yearInfo[year]; - leap = code & 0xf; - ctx->_yday[year] = 0; - if (leap != 0) - { - i = (code >> 16) & 0x1; - ctx->_yday[year] += moon[i]; - /* Big month or small month.... got it. Leap month only - * have two day, big month or small month. */ - } - code >>= 4; - for (i = 0; i < Nmonth-1; i++) - { - /* 12 months. */ - ctx->_yday[year] += moon[code&0x1]; - code >>= 1; - } - ctx->_ymonth[year] = 12; - if (leap != 0) ctx->_ymonth[year]++; - } - return Nyear; -} - - -/* Compute the days of each month in the given lunar year */ -int make_mday(LibLunarContext *ctx, int year) -{ - int i, leapMonth; - long code; - - code = yearInfo[year]; - leapMonth = code & 0xf; - /* leapMonth == 0 means no leap month */ - code >>= 4; - if (leapMonth == 0) - { - ctx->_mday[Nmonth] = 0; - for (i = Nmonth-1; i >= 1; i--) - { - ctx->_mday[i] = moon[code&0x1]; - code >>= 1; - } - } - else - { - /* - There is a leap month (run4 yue4) L in this year. - mday[1] contains the number of days in the 1-st month; - mday[L] contains the number of days in the L-th month; - mday[L+1] contains the number of days in the L-th leap month; - mday[L+2] contains the number of days in the L+1 month, etc. - - cf. yearInfo[]: info about the leap month is encoded differently. - */ - i = (yearInfo[year] >> 16) & 0x1; - ctx->_mday[leapMonth+1] = moon[i]; - - for (i = Nmonth; i >= 1; i--) - { - if (i == leapMonth+1) - i--; - ctx->_mday[i] = moon[code&0x1]; - code >>= 1; - } - } - return leapMonth; -} - - -void Report(SSLunarSimpleDate *solar, SSLunarSimpleDate *lunar, SSLunarSimpleDate *lunar2) -{ - if (showHZ) - ReportGB(solar, lunar, lunar2); - else - ReportE(solar, lunar, lunar2); -} - -#if 0 -void ReportGB(Date *solar, Date *lunar, Date *lunar2) -{ - printf("%s%d%s%2d%s%2d%s%2d%s%s%s\n", "阳历: ", - solar->year, "年", solar->month, "月", solar->day, - "日", solar->hour, "时 ", - "星期", weekdayGB[solar->weekday]); - printf("%s%d%s%s%2d%s%2d%s%s%s%s%s\n", "阴历: ", - lunar->year, "年", (lunar->leap? "闰":""), - lunar->month, "月", lunar->day, "日", - ZhiGB[zhi.hour], "时 ", - "生肖属", ShengXiaoGB[zhi.year]); - printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n", "干支: ", - GanGB[gan.year], ZhiGB[zhi.year], "年 ", - GanGB[gan.month], ZhiGB[zhi.month], "月 ", - GanGB[gan.day], ZhiGB[zhi.day], "日 ", - GanGB[gan.hour], ZhiGB[zhi.hour], "时 "); - printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - "用四柱神算推算之时辰八字: ", - GanGB[gan2.year], ZhiGB[zhi2.year], "年 ", - GanGB[gan2.month], ZhiGB[zhi2.month], "月 ", - GanGB[gan2.day], ZhiGB[zhi2.day], "日 ", - GanGB[gan2.hour], ZhiGB[zhi2.hour], "时 "); - if (jieAlert) - { - printf("* %s, %s\n", "是日为节", - "月柱可能要修改"); - if (lunar2->month==1) - printf("* %s\n", "年柱亦可能要修改"); - printf("* %s\n", "请查有节气时间之万年历"); - } -} - - -void ReportE(Date *solar, Date *lunar, Date *lunar2) -{ - printf("Solar : %d.%d.%d.%d\t%s\n", solar->year, solar->month, solar->day, - solar->hour, weekday[solar->weekday]); - printf("Lunar : %d.%d%s.%d.%d\tShengXiao: %s\n", - lunar->year, lunar->month, (lunar->leap?"Leap":""), lunar->day, - lunar->hour, ShengXiao[zhi.year] ); - printf("GanZhi: %s-%s.%s-%s.%s-%s.%s-%s\n", - Gan[gan.year], Zhi[zhi.year], Gan[gan.month], Zhi[zhi.month], - Gan[gan.day], Zhi[zhi.day], Gan[gan.hour], Zhi[zhi.hour]); - printf(" (GanZhi Order)\t%d-%d.%d-%d.%d-%d.%d-%d\n", - gan.year+1, zhi.year+1, gan.month+1, zhi.month+1, - gan.day+1, zhi.day+1, gan.hour+1, zhi.hour+1); - printf(" (JiaZi Cycle)\t%d.%d.%d.%d\n\n", - GZcycle(gan.year, zhi.year), GZcycle(gan.month, zhi.month), - GZcycle(gan.day, zhi.day), GZcycle(gan.hour, zhi.hour)); - printf("BaZi (8-characters) according to 'Four Column Calculation':\n"); - printf(" %s-%s.%s-%s.%s-%s.%s-%s\n", - Gan[gan2.year], Zhi[zhi2.year], Gan[gan2.month], Zhi[zhi2.month], - Gan[gan2.day], Zhi[zhi2.day], Gan[gan2.hour], Zhi[zhi2.hour]); - printf(" (GanZhi Order)\t%d-%d.%d-%d.%d-%d.%d-%d\n", - gan2.year+1, zhi2.year+1, gan2.month+1, zhi2.month+1, - gan2.day+1, zhi2.day+1, gan2.hour+1, zhi2.hour+1); - printf(" (JiaZi Cycle)\t%d.%d.%d.%d\n\n", - GZcycle(gan2.year, zhi2.year), GZcycle(gan2.month, zhi2.month), - GZcycle(gan2.day, zhi2.day), GZcycle(gan2.hour, zhi2.hour)); - if (jieAlert) - { - printf("* The month column may need adjustment because the date falls on a jie.\n"); - if (lunar2->month==1) - printf("* The day column may need adjustment, too.\n"); - printf("* Please consult a detailed conversion table.\n"); - } -} -#else -void ReportE(SSLunarSimpleDate *solar, SSLunarSimpleDate *lunar, SSLunarSimpleDate *lunar2) {} -void ReportGB(SSLunarSimpleDate *solar, SSLunarSimpleDate *lunar, SSLunarSimpleDate *lunar2) {} -#endif - - - - - diff --git a/Example/SSLunarDate/libLunar.h b/Example/SSLunarDate/libLunar.h deleted file mode 100755 index cfc5882..0000000 --- a/Example/SSLunarDate/libLunar.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// libLunar.h -// SSLunarDate -// -// Created by Jiejing Zhang on 13-2-6. -// Copyright (c) 2013 Jiejing Zhang. All rights reserved. -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#ifndef SSLunarDate_libLunar_h -#define SSLunarDate_libLunar_h - -#include "SSLunarDateType.h" - - -int libLunarCheckYearRange(int year); -void Lunar2Solar(struct LibLunarContext *ctx, SSLunarSimpleDate *lunar); -void Solar2Lunar(struct LibLunarContext *ctx, SSLunarSimpleDate *solar); -SSLunarSimpleDate *getLunarDate(LibLunarContext *ctx); -SSLunarSimpleDate *getSolarDate(LibLunarContext *ctx); - -LibLunarContext * createLunarContext(); -void freeLunarContext(struct LibLunarContext *context); - - -#endif diff --git a/Example/SSLunarDate/zh-Hans.lproj/LunarDateFormatter.strings b/Example/SSLunarDate/zh-Hans.lproj/LunarDateFormatter.strings deleted file mode 100755 index 106d9631e5b871130da0af51811327a2fba75a8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12838 zcmchdPe>GD7{({8P^lIV9f}sr5MiMN6*@%3(4~Zyb|qOPJQ?Lvee3~C_^ zQ&Ol?(7{6xUAjxq;>Ak`A?Q#@1R36fn!a~mhVPlqJ|Qm8Z+7tKJM+yu`^|pgpH?U3 zG&*T#+`JB$*D>>xcM8t5;R$EbY?*O}ok6p0&}`{z9!6z%y@;+TA>M>5CKQ$6p|wW`E1m184YiDkl(T_%p~#n{nP;?(pKMuTLI zQJr?}$0JiWP_zSf+B!B*Zc;#!Nyi(+G5kWLAh}8jG2PSSI|; zn#>BZOj}*HMGu>wm6?{ZENi6ZSvX+!mh>&35K-j#a^oM6V3y}fcG3M z3~(N(#HtDBfnmUV4i*MD4^-mRwBGwJja?~Xj_pJ5&b;llN*vSizIa^`b8PkfwkpXS z%OS8x=2-lEZEWTlF~`zpGPI*-lNsMCt&ZLr}l44*1h+B zjnqe|K{EbVd$-;zHD#-j%&~NUMKZ_IcE{EtnPX`Oi)4=F?u@NPGRJan2A?x1aZHsW z-glHprqUXGds?Xy%anjsjFplQ%hU`#x>6EinQ)a{r6j~L{V3r#6-pe_!~6DHlFYGm z&f>gCiDkmi2A#9K?~M$EB|uGr%znPWNm V+*%}aER8R$MKZ_o3@nn>@)ueoDgFQe diff --git a/Example/SSLunarDate/zh-Hant.lproj/LunarDateFormatter.strings b/Example/SSLunarDate/zh-Hant.lproj/LunarDateFormatter.strings deleted file mode 100755 index 6fd4b3507f44a519efbb41cb58f58c75eec24925..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12836 zcmchdPe>GD7{(|1gW8|PLx&>43=xb9Qi_PE!Ak`#?MzwYpFzvj%s+{m`7+(?e$T|Aq9{}G>1~3yY4IZsyYs7BsR0vu}CWGol zaY$3CpM!Sn)Nx2fo&$H2Iu>bdj3kal%8!x6u}JkXk~kJ=Bt{a)B8|mJ;#j0Ms1QY- zI2NfRMiR#&;dj;|PaKOhS8Z!VktdErdg(p)@JTrDee`%wLf6NNq>htIJ{zAME1pHe z`sez*`seys|J1QEVf}M`Uj1`@tbgiQnXvx3KCk|{KGr{VtV~${T%T9}Tpz2FI##Cm zy(^AGIu5H4qB)c+KoQNM%vIy4spF7-RS$>w)Yy2guW^CaYwS8Ve+Ov?ZjRsPJ)^#z zw@+TtoDp0Xj5b@&*9aJ6YysFX}D6NIhm$`BAP?_P`iJ^UL$oJQlbuLxH=XIXLzEHSRd*>ciPcQw$@3E^qB)ew&}I?Mp)7|rDXc!r;o=is^;r%d|3jO($D>6dcAe@t zqZozQ2dZO{un&wv-a1$mVjrlEl?nU6DCDh!MIrWq>R6eu4~#Jx{&xeN;4_-JUzU3(j5|x1TK<&tAQKSf3z) zXbz>k$7T`Dp;Q7zG>5YPs?8#rL#Y6YXb$CCpUongLmBA9RR(n&QnnwTI_gNI%oO}~ zn$0;DDFJ&Jvl($LQYlpEY(^Z5gnQ(&8F3ua_YD3{p^ihkeZ$^MqB)e4gV+_#<{XQJ z-wb94dA}q*7@C0{lj=B`lF+4y=1|@NMKp(UaAXnI*NCFBundlePackageType FMWK CFBundleShortVersionString - 1.7.0 + 1.7.1.beta CFBundleSignature ???? CFBundleVersion