Compare commits

...

52 Commits

Author SHA1 Message Date
Ivan Smolin 5c12d8ce9e
Merge pull request #4 from elizakova/patch-3
Update source
2021-08-02 11:12:48 +03:00
elizakova e593f6dd49
Update source 2021-08-02 11:24:44 +04:00
Ivan Smolin b3981a3c82
Merge pull request #3 from elizakova/patch-2
Update version
2021-07-29 10:57:13 +03:00
elizakova 2ca467918f
Update version 2021-07-29 10:21:53 +04:00
elizakova f00d48d78d
Merge pull request #2 from elizakova/develop
Develop
2021-07-28 20:05:33 +04:00
elizakova ec1a57f874
Merge pull request #1 from elizakova/change_reload_cell_modifire
Change reload cell modifire
2021-07-28 18:58:27 +04:00
elizakova 5a8153b171
Update FSCalendar.m
Transferring method - (void)reloadDataForCell:(FSCalendarCell *)cell atIndexPath:(NSIndexPath *)indexPath; to FSCalendar.h  for external use
2021-07-28 15:30:49 +04:00
elizakova 7fac27e471
Update FSCalendar.h
Transferring method - (void)reloadDataForCell:(FSCalendarCell *)cell atIndexPath:(NSIndexPath *)indexPath; to FSCalendar.h  for external use
2021-07-28 15:30:06 +04:00
Wenchao Ding 7c5d8c6463
Merge pull request #1301 from tomaskraina/master
Fix for app installation error
2021-06-16 14:46:59 +08:00
Wenchao Ding c4a443ac79
Merge pull request #1300 from sakshibala-halodoc/master
increase iOS deployment target to 9.0
2021-03-07 19:17:39 +08:00
Tom Kraina 36250386e7 Version bump to 2.8.3 2021-03-05 14:55:10 +01:00
Tom Kraina 390ed2804a Fix missing Info.plist file on installation when integrated via Carthage 2021-03-05 14:51:31 +01:00
sakshi.bala fea05cb3a4 increase iOS deployment target to 9.0 2021-03-02 20:24:53 +05:30
Wenchao Ding 1fcac94940
Merge pull request #1273 from MapaX/master
Updated minimum ios deployment target to iOS 9 to support XCode12.x without warnings
2021-02-17 18:32:17 +08:00
Matti Mustonen f6a766d6d6 Updated minimum ios deployment target to iOS 9 to support XCode12.x without warnings 2020-12-17 12:39:17 +02:00
Wenchao Ding 4e79a201fa
Merge pull request #1246 from pju-trifork/spm
Swift Package Manager support
2020-11-28 15:37:24 +08:00
Wenchao Ding 105d8c3592
Update README.md 2020-11-28 15:36:10 +08:00
WenchaoD 0ff2e76087 Fix issues
1.  Fix offset issue of header title
2. Change default date year in examples
3. Version bump 2.8.2
2020-11-19 11:03:25 +08:00
Wenchao Ding 7fd27f977f
Merge pull request #1255 from GithubGaoYang/master
fix: dateBySettingHour return nil when date is very big or very small
2020-11-12 10:52:07 +08:00
高扬 2e6157b307 fix: dateBySettingHour return nil when date is very big or very small
- replace `dateBySettingHour:minute:second:ofDate:options:` to `startOfDayForDate`
2020-11-12 10:35:27 +08:00
Povilas Juzeliunas 617168f216 Cleanup: .xcworkspacedata files removed 2020-10-16 13:23:45 +02:00
Povilas Juzeliunas 4fcf0d8d1d Info.plist removed 2020-10-14 10:21:22 +02:00
Povilas Juzeliunas b60ee2cfb3 CFBundleExecutable removed from Info.plist 2020-10-13 15:14:30 +02:00
Povilas Juzeliunas 7ba522186d Updated README.md 2020-10-09 14:06:02 +02:00
Povilas Juzeliunas ad65db6cb4 Module renamed 2020-10-09 13:45:38 +02:00
Povilas Juzeliunas 725a33a29f Bridging header removed; symlinks to other headers added 2020-10-09 13:41:20 +02:00
Povilas Juzeliunas b3fe27254a Symlink to header 2020-10-09 13:34:07 +02:00
Povilas Juzeliunas 75deddd041 Header file 2020-10-09 13:28:22 +02:00
Povilas Juzeliunas 7a749bfa1f Library target added 2020-10-09 13:16:25 +02:00
Povilas Juzeliunas 252ff40cc9 SPM setup 2020-10-09 13:11:41 +02:00
Wenchao Ding ba15ebc620
Merge pull request #1168 from Ouicar/feature/header_customization
Header customization
2020-09-20 11:04:05 +08:00
Rémi Dayres 4ae56376e9 Appearance : add `FSCalendarCaseOptionsHeaderUsesCapitalized` option 2020-01-24 15:47:39 +01:00
Rémi Dayres adba0b9a8d Appearance : add `headerSeparatorColor` property 2020-01-24 15:47:39 +01:00
Rémi Dayres 714bc0e193 Appearance : add `headerTitleAlignment` property 2020-01-24 15:47:39 +01:00
Rémi Dayres f1afcea1e9 Appearance : add `headerTitleOffset` property 2020-01-24 15:17:08 +01:00
Wenchao Ding ee0a887d8b
Merge pull request #1157 from marcetcheverry/fix-analyzer-warning
Fix 'Converting a pointer value of type 'NSNumber *' warning
2019-12-31 09:24:23 +08:00
Marc Etcheverry 79d413ddd8 Fix 'Converting a pointer value of type 'NSNumber *' to a primitive boolean value' warning 2019-12-30 14:16:09 -08:00
WenchaoD b869b05450 Add version number into framework plist. 2019-12-23 09:27:52 +08:00
WenchaoD b11baf61d1 Fix test failure in demo 2019-12-05 10:38:02 +08:00
WenchaoD 8a2d4b3904 Change version number to 2.8.1 2019-12-05 10:10:22 +08:00
WenchaoD a5a4aff301 Merge branch 'develop' 2019-12-05 10:02:42 +08:00
WenchaoD 1f859e0b9f Fix first-week-disappear issue in demo project 2019-12-05 10:02:35 +08:00
Wenchao Ding d463806165
Merge pull request #855 from pike13inc/master
Use defaultTimeZone instead of localTimeZone
2019-12-05 09:20:35 +08:00
Wenchao Ding f3653ba822
Merge pull request #1124 from michaelin1208/master
Fix #1100 and #1102 issues about showing next week when firstWeekday is not 1 and FSCalendarScopeWeek
2019-12-02 09:39:09 +08:00
Wenchao Ding ee9220cb2a
Merge pull request #506 from JamesKuang/master
Define FSCalendarMaximumNumberOfEvents constant for hardcoded value
2019-11-29 09:27:39 +08:00
lin.chao cdbb9ec7ca Fix https://github.com/WenchaoD/FSCalendar/issues/1100 and https://github.com/WenchaoD/FSCalendar/issues/1102
If firstWeekday is not 1, and weekday is less than firstWeekday, the middleDayOfWeek will be the middle day of next week
2019-10-21 16:07:14 +08:00
Wenchao Ding 473e88cb26
Merge pull request #1110 from marcetcheverry/fix-uifont-size-13
Fixes iOS 13 reverting back to "Times New Roman" when changing the font size of default system fonts
2019-10-14 10:27:25 +08:00
Marc Etcheverry b66d3133c0 Fixes iOS 13 reverting back to "Times New Roman" when changing the font size of default system fonts 2019-09-11 14:55:12 -07:00
WenchaoD b0653a3b69 Remove unused methods in dynamic header file. 2018-12-10 11:55:51 +08:00
Ted Whang b47c17b617 Use defaultTimeZone instead of localTimeZone 2017-12-29 16:13:09 -08:00
James Kuang 49d9408b06 Merge remote-tracking branch 'upstream/master' 2017-03-07 23:01:06 -05:00
James Kuang 8792e46a2f Define FSCalendarMaximumNumberOfEvents constant for hardcoded value 2016-12-03 14:08:24 -05:00
46 changed files with 372 additions and 155 deletions

View File

@ -105,7 +105,7 @@
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter dateFromString:@"2016-07-08"];
return [self.dateFormatter dateFromString:@"2020-07-08"];
}
- (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar

View File

@ -42,68 +42,68 @@ NS_ASSUME_NONNULL_END
if (self) {
self.title = @"FSCalendar";
self.fillDefaultColors = @{@"2015/10/08":[UIColor purpleColor],
@"2015/10/06":[UIColor greenColor],
@"2015/10/18":[UIColor cyanColor],
@"2015/10/22":[UIColor yellowColor],
@"2015/11/08":[UIColor purpleColor],
@"2015/11/06":[UIColor greenColor],
@"2015/11/18":[UIColor cyanColor],
@"2015/11/22":[UIColor yellowColor],
@"2015/12/08":[UIColor purpleColor],
@"2015/12/06":[UIColor greenColor],
@"2015/12/18":[UIColor cyanColor],
@"2015/12/22":[UIColor magentaColor]};
self.fillDefaultColors = @{@"2020/10/08":[UIColor purpleColor],
@"2020/10/06":[UIColor greenColor],
@"2020/10/18":[UIColor cyanColor],
@"2020/10/22":[UIColor yellowColor],
@"2020/11/08":[UIColor purpleColor],
@"2020/11/06":[UIColor greenColor],
@"2020/11/18":[UIColor cyanColor],
@"2020/11/22":[UIColor yellowColor],
@"2020/12/08":[UIColor purpleColor],
@"2020/12/06":[UIColor greenColor],
@"2020/12/18":[UIColor cyanColor],
@"2020/12/22":[UIColor magentaColor]};
self.fillSelectionColors = @{@"2015/10/08":[UIColor greenColor],
@"2015/10/06":[UIColor purpleColor],
@"2015/10/17":[UIColor grayColor],
@"2015/10/21":[UIColor cyanColor],
@"2015/11/08":[UIColor greenColor],
@"2015/11/06":[UIColor purpleColor],
@"2015/11/17":[UIColor grayColor],
@"2015/11/21":[UIColor cyanColor],
@"2015/12/08":[UIColor greenColor],
@"2015/12/06":[UIColor purpleColor],
@"2015/12/17":[UIColor grayColor],
@"2015/12/21":[UIColor cyanColor]};
self.fillSelectionColors = @{@"2020/10/08":[UIColor greenColor],
@"2020/10/06":[UIColor purpleColor],
@"2020/10/17":[UIColor grayColor],
@"2020/10/21":[UIColor cyanColor],
@"2020/11/08":[UIColor greenColor],
@"2020/11/06":[UIColor purpleColor],
@"2020/11/17":[UIColor grayColor],
@"2020/11/21":[UIColor cyanColor],
@"2020/12/08":[UIColor greenColor],
@"2020/12/06":[UIColor purpleColor],
@"2020/12/17":[UIColor grayColor],
@"2020/12/21":[UIColor cyanColor]};
self.borderDefaultColors = @{@"2015/10/08":[UIColor brownColor],
@"2015/10/17":[UIColor magentaColor],
@"2015/10/21":FSCalendarStandardSelectionColor,
@"2015/10/25":[UIColor blackColor],
@"2015/11/08":[UIColor brownColor],
@"2015/11/17":[UIColor magentaColor],
@"2015/11/21":FSCalendarStandardSelectionColor,
@"2015/11/25":[UIColor blackColor],
@"2015/12/08":[UIColor brownColor],
@"2015/12/17":[UIColor magentaColor],
@"2015/12/21":FSCalendarStandardSelectionColor,
@"2015/12/25":[UIColor blackColor]};
self.borderDefaultColors = @{@"2020/10/08":[UIColor brownColor],
@"2020/10/17":[UIColor magentaColor],
@"2020/10/21":FSCalendarStandardSelectionColor,
@"2020/10/25":[UIColor blackColor],
@"2020/11/08":[UIColor brownColor],
@"2020/11/17":[UIColor magentaColor],
@"2020/11/21":FSCalendarStandardSelectionColor,
@"2020/11/25":[UIColor blackColor],
@"2020/12/08":[UIColor brownColor],
@"2020/12/17":[UIColor magentaColor],
@"2020/12/21":FSCalendarStandardSelectionColor,
@"2020/12/25":[UIColor blackColor]};
self.borderSelectionColors = @{@"2015/10/08":[UIColor redColor],
@"2015/10/17":[UIColor purpleColor],
@"2015/10/21":FSCalendarStandardSelectionColor,
@"2015/10/25":FSCalendarStandardTodayColor,
@"2015/11/08":[UIColor redColor],
@"2015/11/17":[UIColor purpleColor],
@"2015/11/21":FSCalendarStandardSelectionColor,
@"2015/11/25":FSCalendarStandardTodayColor,
@"2015/12/08":[UIColor redColor],
@"2015/12/17":[UIColor purpleColor],
@"2015/12/21":FSCalendarStandardSelectionColor,
@"2015/12/25":FSCalendarStandardTodayColor};
self.borderSelectionColors = @{@"2020/10/08":[UIColor redColor],
@"2020/10/17":[UIColor purpleColor],
@"2020/10/21":FSCalendarStandardSelectionColor,
@"2020/10/25":FSCalendarStandardTodayColor,
@"2020/11/08":[UIColor redColor],
@"2020/11/17":[UIColor purpleColor],
@"2020/11/21":FSCalendarStandardSelectionColor,
@"2020/11/25":FSCalendarStandardTodayColor,
@"2020/12/08":[UIColor redColor],
@"2020/12/17":[UIColor purpleColor],
@"2020/12/21":FSCalendarStandardSelectionColor,
@"2020/12/25":FSCalendarStandardTodayColor};
self.datesWithEvent = @[@"2015-10-03",
@"2015-10-06",
@"2015-10-12",
@"2015-10-25"];
self.datesWithEvent = @[@"2020-10-03",
@"2020-10-06",
@"2020-10-12",
@"2020-10-25"];
self.datesWithMultipleEvents = @[@"2015-10-08",
@"2015-10-16",
@"2015-10-20",
@"2015-10-28"];
self.datesWithMultipleEvents = @[@"2020-10-08",
@"2020-10-16",
@"2020-10-20",
@"2020-10-28"];
self.gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
@ -134,7 +134,7 @@ NS_ASSUME_NONNULL_END
[self.view addSubview:calendar];
self.calendar = calendar;
[calendar setCurrentPage:[self.dateFormatter1 dateFromString:@"2015/10/03"] animated:NO];
[calendar setCurrentPage:[self.dateFormatter1 dateFromString:@"2020/10/03"] animated:NO];
UIBarButtonItem *todayItem = [[UIBarButtonItem alloc] initWithTitle:@"TODAY" style:UIBarButtonItemStylePlain target:self action:@selector(todayItemClicked:)];
self.navigationItem.rightBarButtonItem = todayItem;

View File

@ -141,7 +141,7 @@
30A495521DCAD9E6000B2F31 /* FSCalendarWeekdayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarWeekdayView.h; sourceTree = "<group>"; };
30A495531DCAD9E6000B2F31 /* FSCalendarWeekdayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarWeekdayView.m; sourceTree = "<group>"; };
30B0BABF1B8D8E22004B9476 /* FSCalendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendar.h; sourceTree = "<group>"; };
30B0BAC01B8D8E22004B9476 /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FSCalendar.m; sourceTree = "<group>"; };
30B0BAC01B8D8E22004B9476 /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FSCalendar.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
30B0BAC11B8D8E22004B9476 /* FSCalendarAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarAppearance.h; sourceTree = "<group>"; };
30B0BAC21B8D8E22004B9476 /* FSCalendarAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarAppearance.m; sourceTree = "<group>"; };
30B0BAC31B8D8E22004B9476 /* FSCalendarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = FSCalendarCell.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
@ -149,7 +149,6 @@
30B0BAC51B8D8E22004B9476 /* FSCalendarDynamicHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarDynamicHeader.h; sourceTree = "<group>"; };
30B0BAC61B8D8E22004B9476 /* FSCalendarHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarHeaderView.h; sourceTree = "<group>"; };
30B0BAC71B8D8E22004B9476 /* FSCalendarHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarHeaderView.m; sourceTree = "<group>"; };
30B0BACA1B8D8E22004B9476 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
30CEF8FE1C950C1F008EAFB1 /* FSCalendarTransitionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarTransitionCoordinator.h; sourceTree = "<group>"; };
30CEF8FF1C950C1F008EAFB1 /* FSCalendarTransitionCoordinator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarTransitionCoordinator.m; sourceTree = "<group>"; };
30D55B0E1C90240000BB43D5 /* HidePlaceholderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HidePlaceholderViewController.h; sourceTree = SOURCE_ROOT; };
@ -162,6 +161,7 @@
30FCB3951BAAD112002B87AD /* FSCalendarStickyHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarStickyHeader.m; sourceTree = "<group>"; };
50F2ADE6216D954A00CC481F /* FSCalendarSeparatorDecorationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FSCalendarSeparatorDecorationView.h; sourceTree = "<group>"; };
50F2ADE7216D954A00CC481F /* FSCalendarSeparatorDecorationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSCalendarSeparatorDecorationView.m; sourceTree = "<group>"; };
9C88197F25F26B2F00E180CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
EE0D7FC71B89C5D3003C287B /* FSCalendarExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FSCalendarExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
EE0D7FCB1B89C5D3003C287B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
EE52AE161B91E68A00016662 /* FSCalendarScopeExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarScopeExampleViewController.h; sourceTree = SOURCE_ROOT; };
@ -261,6 +261,7 @@
30B0BABC1B8D8E22004B9476 /* FSCalendar */ = {
isa = PBXGroup;
children = (
9C88197F25F26B2F00E180CD /* Info.plist */,
30B0BABF1B8D8E22004B9476 /* FSCalendar.h */,
30B0BAC01B8D8E22004B9476 /* FSCalendar.m */,
30B0BAC11B8D8E22004B9476 /* FSCalendarAppearance.h */,
@ -292,20 +293,11 @@
309225381B905C4300123031 /* FSCalendarConstants.h */,
309225391B905C4300123031 /* FSCalendarConstants.m */,
30B0BAC51B8D8E22004B9476 /* FSCalendarDynamicHeader.h */,
30B0BAF31B8D9A91004B9476 /* Supporting Files */,
);
name = FSCalendar;
path = ../FSCalendar;
sourceTree = "<group>";
};
30B0BAF31B8D9A91004B9476 /* Supporting Files */ = {
isa = PBXGroup;
children = (
30B0BACA1B8D8E22004B9476 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
30D55B0D1C9023E400BB43D5 /* Hide Placeholders */ = {
isa = PBXGroup;
children = (
@ -588,7 +580,7 @@
};
buildConfigurationList = EE0D7FC21B89C5D3003C287B /* Build configuration list for PBXProject "FSCalendar" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@ -894,7 +886,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = HZF422TY46;
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.wenchaod.FSCalendarExample;
PRODUCT_NAME = "$(TARGET_NAME)";
@ -908,7 +900,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = HZF422TY46;
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.wenchaod.FSCalendarExample;
PRODUCT_NAME = "$(TARGET_NAME)";
@ -931,8 +923,9 @@
);
INFOPLIST_FILE = "$(SRCROOT)/../FSCalendar/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.8.3;
PRODUCT_BUNDLE_IDENTIFIER = com.wenchaod.FSCalendar;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
@ -953,8 +946,9 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/../FSCalendar/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.8.3;
PRODUCT_BUNDLE_IDENTIFIER = com.wenchaod.FSCalendar;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EE0D7FC61B89C5D3003C287B"
BuildableName = "FSCalendarExample.app"
BlueprintName = "FSCalendarExample"
ReferencedContainer = "container:FSCalendar.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "30671DC61D6D574C00BCFC4E"
BuildableName = "FSCalendarTests.xctest"
BlueprintName = "FSCalendarTests"
ReferencedContainer = "container:FSCalendar.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F9384A611E3ACEFB001601E0"
BuildableName = "FSCalendarExampleUITests.xctest"
BlueprintName = "FSCalendarExampleUITests"
ReferencedContainer = "container:FSCalendar.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EE0D7FC61B89C5D3003C287B"
BuildableName = "FSCalendarExample.app"
BlueprintName = "FSCalendarExample"
ReferencedContainer = "container:FSCalendar.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EE0D7FC61B89C5D3003C287B"
BuildableName = "FSCalendarExample.app"
BlueprintName = "FSCalendarExample"
ReferencedContainer = "container:FSCalendar.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -43,14 +43,14 @@
[[application.tables elementBoundByIndex:0].cells[@"DIY Example, Feature!"] tap];
XCUIElement *calendar = application.otherElements[@"calendar"];
XCUICoordinate *swipeStart = [calendar coordinateWithNormalizedOffset:CGVectorMake(0.5/7.0, 0.5)];
XCUICoordinate *swipeStart = [calendar coordinateWithNormalizedOffset:CGVectorMake(0.8/7.0, 0.5)];
XCUICoordinate *swipeEnd = [calendar coordinateWithNormalizedOffset:CGVectorMake(6.5/7.0, 0.5)];
[swipeStart pressForDuration:0.8 thenDragToCoordinate:swipeEnd];
[calendar swipeUp];
[calendar swipeLeft];
swipeStart = [calendar coordinateWithNormalizedOffset:CGVectorMake(0.5/7.0, 0.75)];
swipeStart = [calendar coordinateWithNormalizedOffset:CGVectorMake(0.8/7.0, 0.75)];
swipeEnd = [calendar coordinateWithNormalizedOffset:CGVectorMake(6.5/7.0, 0.75)];
[swipeStart pressForDuration:0.8 thenDragToCoordinate:swipeEnd];
[calendar swipeDown];
@ -64,8 +64,8 @@
{
XCUIApplication *application = [[XCUIApplication alloc] init];
[[application.tables elementBoundByIndex:0].cells[@"Prev-Next Buttons"] tap];
XCUIElement *prevButton = [application.buttons elementBoundByIndex:2];
XCUIElement *nextButton = [application.buttons elementBoundByIndex:3];
XCUIElement *prevButton = [application.buttons elementBoundByIndex:1];
XCUIElement *nextButton = [application.buttons elementBoundByIndex:2];
NSInteger count = 3;
for (int i = 0; i < count; i++) {
[prevButton tap];
@ -199,7 +199,7 @@
CGVector vector1 = CGVectorMake(columnWidth * 3.5, cellStart + rowHeight * 2.5);
CGVector vector2 = CGVectorMake(columnWidth * 4.5, cellStart + rowHeight * 2.5);
XCUIElement *configureButton = [application.buttons elementBoundByIndex:2];
XCUIElement *configureButton = [application.buttons elementBoundByIndex:1];
[NSThread sleepForTimeInterval:0.5];
[configureButton tap];

View File

@ -49,7 +49,6 @@ NS_ASSUME_NONNULL_END
if ([[UIDevice currentDevice].model hasPrefix:@"iPad"]) {
self.calendarHeightConstraint.constant = 400;
}
[self.calendar selectDate:[NSDate date] scrollToDate:YES];
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self.calendar action:@selector(handleScopeGesture:)];
panGesture.delegate = self;
@ -65,6 +64,8 @@ NS_ASSUME_NONNULL_END
self.calendar.placeholderType = FSCalendarPlaceholderTypeNone;
self.calendar.scope = FSCalendarScopeWeek;
[self.calendar selectDate:[NSDate date] scrollToDate:YES];
// For UITest
self.calendar.accessibilityIdentifier = @"calendar";

View File

@ -114,20 +114,13 @@ NS_ASSUME_NONNULL_END
self.dateFormatter = [[NSDateFormatter alloc] init];
self.dateFormatter.dateFormat = @"yyyy-MM-dd";
self.minimumDate = [self.dateFormatter dateFromString:@"2016-02-03"];
self.maximumDate = [self.dateFormatter dateFromString:@"2021-04-10"];
self.minimumDate = [self.dateFormatter dateFromString:@"2020-02-03"];
self.maximumDate = [self.dateFormatter dateFromString:@"2023-04-10"];
self.calendar.accessibilityIdentifier = @"calendar";
[self loadCalendarEvents];
/*
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.minimumDate = [self.dateFormatter dateFromString:@"2015-02-01"];
self.maximumDate = [self.dateFormatter dateFromString:@"2015-06-10"];
[self.calendar reloadData];
});
*/
}
- (void)didReceiveMemoryWarning

View File

@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_END
calendar.delegate = self;
calendar.placeholderType = FSCalendarPlaceholderTypeNone;
calendar.adjustsBoundingRectWhenChangingMonths = YES;
calendar.currentPage = [self.dateFormatter dateFromString:@"2016-06-01"];
calendar.currentPage = [self.dateFormatter dateFromString:@"2020-06-01"];
calendar.firstWeekday = 2;
calendar.scrollDirection = FSCalendarScrollDirectionVertical;
[self.view addSubview:calendar];
@ -126,12 +126,12 @@ NS_ASSUME_NONNULL_END
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter dateFromString:@"2016-01-08"];
return [self.dateFormatter dateFromString:@"2020-01-08"];
}
- (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter dateFromString:@"2018-10-08"];
return [self.dateFormatter dateFromString:@"2023-10-08"];
}
- (void)dealloc

View File

@ -31,10 +31,10 @@ NS_ASSUME_NONNULL_END
self = [super init];
if (self) {
self.title = @"FSCalendar";
self.images = @{@"2016/11/01":[UIImage imageNamed:@"icon_cat"],
@"2016/11/05":[UIImage imageNamed:@"icon_footprint"],
@"2016/11/20":[UIImage imageNamed:@"icon_cat"],
@"2016/11/07":[UIImage imageNamed:@"icon_footprint"]};
self.images = @{@"2020/11/01":[UIImage imageNamed:@"icon_cat"],
@"2020/11/05":[UIImage imageNamed:@"icon_footprint"],
@"2020/11/20":[UIImage imageNamed:@"icon_cat"],
@"2020/11/07":[UIImage imageNamed:@"icon_footprint"]};
}
return self;
}
@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_END
self.dateFormatter.dateFormat = @"yyyy/MM/dd";
// [self.calendar selectDate:[self.dateFormatter dateFromString:@"2016/02/03"]];
// [self.calendar selectDate:[self.dateFormatter dateFromString:@"2020/02/03"]];
/*
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@ -115,12 +115,12 @@ NS_ASSUME_NONNULL_END
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter dateFromString:@"2016/10/01"];
return [self.dateFormatter dateFromString:@"2020/10/01"];
}
- (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter dateFromString:@"2017/10/10"];
return [self.dateFormatter dateFromString:@"2023/10/10"];
}

View File

@ -91,7 +91,7 @@
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter dateFromString:@"2016-07-08"];
return [self.dateFormatter dateFromString:@"2020-07-08"];
}
- (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar

View File

@ -54,18 +54,18 @@
self.calendar.appearance.caseOptions = FSCalendarCaseOptionsHeaderUsesUpperCase|FSCalendarCaseOptionsWeekdayUsesUpperCase;
self.datesShouldNotBeSelected = @[@"2016/08/07",
@"2016/09/07",
@"2016/10/07",
@"2016/11/07",
@"2016/12/07",
@"2016/01/07",
@"2016/02/07"];
self.datesShouldNotBeSelected = @[@"2020/08/07",
@"2020/09/07",
@"2020/10/07",
@"2020/11/07",
@"2020/12/07",
@"2020/01/07",
@"2020/02/07"];
self.datesWithEvent = @[@"2016-12-03",
@"2016-12-07",
@"2016-12-15",
@"2016-12-25"];
self.datesWithEvent = @[@"2020-12-03",
@"2020-12-07",
@"2020-12-15",
@"2020-12-25"];
self.lunarFormatter = [[LunarFormatter alloc] init];
}
@ -81,7 +81,8 @@
if ([[UIDevice currentDevice].model hasPrefix:@"iPad"]) {
self.calendarHeightConstraint.constant = 400;
}
[self.calendar selectDate:[self.dateFormatter1 dateFromString:@"2016/12/05"] scrollToDate:YES];
self.calendar.today = [self.dateFormatter1 dateFromString:@"2020/11/19"];
// [self.calendar selectDate:[self.dateFormatter1 dateFromString:@"2020/11/09"] scrollToDate:YES];
self.calendar.accessibilityIdentifier = @"calendar";
@ -117,12 +118,12 @@
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter1 dateFromString:@"2016/10/01"];
return [self.dateFormatter1 dateFromString:@"2020/10/01"];
}
- (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar
{
return [self.dateFormatter1 dateFromString:@"2018/05/31"];
return [self.dateFormatter1 dateFromString:@"2023/05/31"];
}
#pragma mark - FSCalendarDelegate

View File

@ -57,12 +57,12 @@
305282C81E1608A100CC2877 /* FSCalendarScopeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FSCalendarScopeViewController.swift; sourceTree = "<group>"; };
30D458E81DB4E2DB00B163C7 /* LoadViewExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadViewExampleViewController.swift; sourceTree = "<group>"; };
30F4C9191E07C3AD00D2EC4D /* FSCalendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendar.h; sourceTree = "<group>"; };
30F4C91A1E07C3AD00D2EC4D /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendar.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
30F4C91A1E07C3AD00D2EC4D /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendar.m; sourceTree = "<group>"; };
30F4C91D1E07C3AD00D2EC4D /* FSCalendarAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarAppearance.h; sourceTree = "<group>"; };
30F4C91E1E07C3AD00D2EC4D /* FSCalendarAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarAppearance.m; sourceTree = "<group>"; };
30F4C91F1E07C3AD00D2EC4D /* FSCalendarCalculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarCalculator.h; sourceTree = "<group>"; };
30F4C9201E07C3AD00D2EC4D /* FSCalendarCalculator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarCalculator.m; sourceTree = "<group>"; };
30F4C9211E07C3AD00D2EC4D /* FSCalendarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarCell.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
30F4C9211E07C3AD00D2EC4D /* FSCalendarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarCell.h; sourceTree = "<group>"; };
30F4C9221E07C3AD00D2EC4D /* FSCalendarCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarCell.m; sourceTree = "<group>"; };
30F4C9231E07C3AD00D2EC4D /* FSCalendarCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarCollectionView.h; sourceTree = "<group>"; };
30F4C9241E07C3AD00D2EC4D /* FSCalendarCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarCollectionView.m; sourceTree = "<group>"; };
@ -288,6 +288,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);

View File

@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = "FSCalendar"
s.version = "2.8.0"
s.version = "2.8.4"
s.summary = "A superiorly awesome iOS7+ calendar control, compatible with Objective-C and Swift."
s.homepage = "https://github.com/WenchaoD/FSCalendar"
s.screenshots = "https://cloud.githubusercontent.com/assets/5186464/10262249/4fabae40-69f2-11e5-97ab-afbacd0a3da2.jpg"
s.license = 'MIT'
s.author = { "Wenchao Ding" => "f33chobits@gmail.com" }
s.source = { :git => "https://github.com/WenchaoD/FSCalendar.git", :tag => s.version.to_s }
s.source = { :git => "https://github.com/TouchInstinct/FSCalendar.git", :tag => s.version.to_s }
s.platform = :ios
s.ios.deployment_target = '8.0'

View File

@ -407,6 +407,11 @@ IB_DESIGNABLE
*/
- (void)reloadData;
/**
Reload data of the calendar cell.
*/
- (void)reloadDataForCell:(FSCalendarCell *)cell atIndexPath:(NSIndexPath *)indexPath;
/**
Change the scope of the calendar. Make sure `-calendar:boundingRectWillChange:animated` is correctly adopted.

View File

@ -110,8 +110,6 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
- (void)selectCounterpartDate:(NSDate *)date;
- (void)deselectCounterpartDate:(NSDate *)date;
- (void)reloadDataForCell:(FSCalendarCell *)cell atIndexPath:(NSIndexPath *)indexPath;
- (void)adjustMonthPosition;
- (BOOL)requestBoundingDatesIfNecessary;
- (void)executePendingOperationsIfNeeded;
@ -153,11 +151,11 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
_formatter = [[NSDateFormatter alloc] init];
_formatter.dateFormat = @"yyyy-MM-dd";
_locale = [NSLocale currentLocale];
_timeZone = [NSTimeZone localTimeZone];
_timeZone = [NSTimeZone defaultTimeZone];
_firstWeekday = 1;
[self invalidateDateTools];
_today = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:[NSDate date] options:0];
_today = [self.gregorian startOfDayForDate:[NSDate date]];
_currentPage = [self.gregorian fs_firstDayOfMonth:_today];
@ -701,7 +699,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
_today = nil;
} else {
FSCalendarAssertDateInBounds(today,self.gregorian,self.minimumDate,self.maximumDate);
_today = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:today options:0];
_today = [self.gregorian startOfDayForDate:today];
}
if (self.hasValidateVisibleLayout) {
[self.visibleCells makeObjectsPerformSelector:@selector(setDateIsToday:) withObject:nil];
@ -719,7 +717,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
{
[self requestBoundingDatesIfNecessary];
if (self.floatingMode || [self isDateInDifferentPage:currentPage]) {
currentPage = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:currentPage options:0];
currentPage = [self.gregorian startOfDayForDate:currentPage];
if ([self isPageInRange:currentPage]) {
[self scrollToPageForDate:currentPage animated:animated];
}
@ -1037,7 +1035,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
- (void)deselectDate:(NSDate *)date
{
date = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:date options:0];
date = [self.gregorian startOfDayForDate:date];
if (![_selectedDates containsObject:date]) {
return;
}
@ -1060,7 +1058,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
FSCalendarAssertDateInBounds(date,self.gregorian,self.minimumDate,self.maximumDate);
NSDate *targetDate = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:date options:0];
NSDate *targetDate = [self.gregorian startOfDayForDate:date];
NSIndexPath *targetIndexPath = [self.calculator indexPathForDate:targetDate];
BOOL shouldSelect = YES;
@ -1534,9 +1532,9 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
_needsRequestingBoundingDates = NO;
self.formatter.dateFormat = @"yyyy-MM-dd";
NSDate *newMin = [self.dataSourceProxy minimumDateForCalendar:self]?:[self.formatter dateFromString:@"1970-01-01"];
newMin = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:newMin options:0];
newMin = [self.gregorian startOfDayForDate:newMin];
NSDate *newMax = [self.dataSourceProxy maximumDateForCalendar:self]?:[self.formatter dateFromString:@"2099-12-31"];
newMax = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:newMax options:0];
newMax = [self.gregorian startOfDayForDate:newMax];
NSAssert([self.gregorian compareDate:newMin toDate:newMax toUnitGranularity:NSCalendarUnitDay] != NSOrderedDescending, @"The minimum date of calendar should be earlier than the maximum.");

View File

@ -29,7 +29,8 @@ typedef NS_ENUM(NSUInteger, FSCalendarSeparators) {
typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) {
FSCalendarCaseOptionsHeaderUsesDefaultCase = 0,
FSCalendarCaseOptionsHeaderUsesUpperCase = 1,
FSCalendarCaseOptionsHeaderUsesUpperCase = 1 << 0,
FSCalendarCaseOptionsHeaderUsesCapitalized = 1 << 1,
FSCalendarCaseOptionsWeekdayUsesDefaultCase = 0 << 4,
FSCalendarCaseOptionsWeekdayUsesUpperCase = 1 << 4,
@ -63,6 +64,11 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) {
*/
@property (strong, nonatomic) UIFont *headerTitleFont;
/**
* The offset of the month header from default position.
*/
@property (assign, nonatomic) CGPoint headerTitleOffset;
/**
* The offset of the day text from default position.
*/
@ -103,11 +109,21 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) {
*/
@property (strong, nonatomic) UIColor *headerTitleColor;
/**
* The color oh month header separator
*/
@property (strong, nonatomic) UIColor *headerSeparatorColor;
/**
* The date format of the month header.
*/
@property (strong, nonatomic) NSString *headerDateFormat;
/**
* The text alignment of the month header.
*/
@property (assign, nonatomic) NSTextAlignment headerTitleAlignment;
/**
* The alpha value of month label staying on the fringes.
*/

View File

@ -36,8 +36,11 @@
_headerTitleFont = [UIFont systemFontOfSize:FSCalendarStandardHeaderTextSize];
_headerTitleColor = FSCalendarStandardTitleTextColor;
_headerSeparatorColor = FSCalendarStandardLineColor;
_headerDateFormat = @"MMMM yyyy";
_headerMinimumDissolvedAlpha = 0.2;
_headerTitleOffset = CGPointZero;
_headerTitleAlignment = NSTextAlignmentCenter;
_weekdayTextColor = FSCalendarStandardTitleTextColor;
_caseOptions = FSCalendarCaseOptionsHeaderUsesDefaultCase|FSCalendarCaseOptionsWeekdayUsesDefaultCase;
@ -111,6 +114,13 @@
}
}
- (void)setHeaderTitleOffset:(CGPoint)headerTitleOffset {
if (!CGPointEqualToPoint(_headerTitleOffset, headerTitleOffset)) {
_headerTitleOffset = headerTitleOffset;
[self.calendar configureAppearance];
}
}
- (void)setTitleOffset:(CGPoint)titleOffset
{
if (!CGPointEqualToPoint(_titleOffset, titleOffset)) {
@ -402,6 +412,14 @@
}
}
- (void)setHeaderSeparatorColor:(UIColor *)headerSeparatorColor
{
if (![_headerSeparatorColor isEqual:headerSeparatorColor]) {
_headerSeparatorColor = headerSeparatorColor;
[self.calendar configureAppearance];
}
}
- (void)setHeaderMinimumDissolvedAlpha:(CGFloat)headerMinimumDissolvedAlpha
{
if (_headerMinimumDissolvedAlpha != headerMinimumDissolvedAlpha) {
@ -418,6 +436,14 @@
}
}
- (void)setHeaderTitleAlignment:(NSTextAlignment)headerTitleAlignment
{
if (_headerTitleAlignment != headerTitleAlignment) {
_headerTitleAlignment = headerTitleAlignment;
[self.calendar configureAppearance];
}
}
- (void)setCaseOptions:(FSCalendarCaseOptions)caseOptions
{
if (_caseOptions != caseOptions) {
@ -482,22 +508,22 @@
- (void)setTitleTextSize:(CGFloat)titleTextSize
{
self.titleFont = [UIFont fontWithName:self.titleFont.fontName size:titleTextSize];
self.titleFont = [self.titleFont fontWithSize:titleTextSize];
}
- (void)setSubtitleTextSize:(CGFloat)subtitleTextSize
{
self.subtitleFont = [UIFont fontWithName:self.subtitleFont.fontName size:subtitleTextSize];
self.subtitleFont = [self.subtitleFont fontWithSize:subtitleTextSize];
}
- (void)setWeekdayTextSize:(CGFloat)weekdayTextSize
{
self.weekdayFont = [UIFont fontWithName:self.weekdayFont.fontName size:weekdayTextSize];
self.weekdayFont = [self.weekdayFont fontWithSize:weekdayTextSize];
}
- (void)setHeaderTitleTextSize:(CGFloat)headerTitleTextSize
{
self.headerTitleFont = [UIFont fontWithName:self.headerTitleFont.fontName size:headerTitleTextSize];
self.headerTitleFont = [self.headerTitleFont fontWithSize:headerTitleTextSize];
}
- (void)invalidateAppearance

View File

@ -221,7 +221,7 @@
if (self.calendar.placeholderType == FSCalendarPlaceholderTypeFillSixRows) return 6;
NSNumber *rowCount = self.rowCounts[month];
if (!rowCount) {
if (rowCount == nil) {
NSDate *firstDayOfMonth = [self.gregorian fs_firstDayOfMonth:month];
NSInteger weekdayOfFirstDay = [self.gregorian component:NSCalendarUnitWeekday fromDate:firstDayOfMonth];
NSInteger numberOfDaysInMonth = [self.gregorian fs_numberOfDaysInMonth:month];

View File

@ -387,7 +387,7 @@ OFFSET_PROPERTY(preferredEventOffset, PreferredEventOffset, _appearance.eventOff
self.contentView = view;
self.eventLayers = [NSPointerArray weakObjectsPointerArray];
for (int i = 0; i < 3; i++) {
for (int i = 0; i < FSCalendarMaximumNumberOfEvents; i++) {
CALayer *layer = [CALayer layer];
layer.backgroundColor = [UIColor clearColor].CGColor;
[self.contentView.layer addSublayer:layer];
@ -450,7 +450,7 @@ OFFSET_PROPERTY(preferredEventOffset, PreferredEventOffset, _appearance.eventOff
- (void)setNumberOfEvents:(NSInteger)numberOfEvents
{
if (_numberOfEvents != numberOfEvents) {
_numberOfEvents = MIN(MAX(numberOfEvents,0),3);
_numberOfEvents = MIN(MAX(numberOfEvents,0),FSCalendarMaximumNumberOfEvents);
[self setNeedsLayout];
}
}

View File

@ -29,6 +29,7 @@ CG_EXTERN CGFloat const FSCalendarStandardHeaderTextSize;
CG_EXTERN CGFloat const FSCalendarMaximumEventDotDiameter;
UIKIT_EXTERN NSInteger const FSCalendarDefaultHourComponent;
UIKIT_EXTERN NSInteger const FSCalendarMaximumNumberOfEvents;
UIKIT_EXTERN NSString * const FSCalendarDefaultCellReuseIdentifier;
UIKIT_EXTERN NSString * const FSCalendarBlankCellReuseIdentifier;

View File

@ -26,6 +26,7 @@ CGFloat const FSCalendarStandardHeaderTextSize = 16.5;
CGFloat const FSCalendarMaximumEventDotDiameter = 4.8;
NSInteger const FSCalendarDefaultHourComponent = 0;
NSInteger const FSCalendarMaximumNumberOfEvents = 3;
NSString * const FSCalendarDefaultCellReuseIdentifier = @"_FSCalendarDefaultCellReuseIdentifier";
NSString * const FSCalendarBlankCellReuseIdentifier = @"_FSCalendarBlankCellReuseIdentifier";

View File

@ -31,7 +31,6 @@
@property (readonly, nonatomic) NSArray *visibleStickyHeaders;
@property (readonly, nonatomic) CGFloat preferredHeaderHeight;
@property (readonly, nonatomic) CGFloat preferredWeekdayHeight;
@property (readonly, nonatomic) UIView *bottomBorder;
@property (readonly, nonatomic) NSCalendar *gregorian;
@property (readonly, nonatomic) NSDateFormatter *formatter;
@ -41,13 +40,9 @@
@property (assign, nonatomic) BOOL needsAdjustingViewFrame;
- (void)invalidateHeaders;
- (void)adjustMonthPosition;
- (void)configureAppearance;
- (BOOL)isPageInRange:(NSDate *)page;
- (BOOL)isDateInRange:(NSDate *)date;
- (CGSize)sizeThatFits:(CGSize)size scope:(FSCalendarScope)scope;
@end

View File

@ -171,7 +171,7 @@
components.day = - (weekdayComponents.weekday - self.firstWeekday);
components.day = (components.day-7) % 7;
NSDate *firstDayOfWeek = [self dateByAddingComponents:components toDate:week options:0];
firstDayOfWeek = [self dateBySettingHour:0 minute:0 second:0 ofDate:firstDayOfWeek options:0];
firstDayOfWeek = [self startOfDayForDate:firstDayOfWeek];
components.day = NSIntegerMax;
return firstDayOfWeek;
}
@ -184,7 +184,7 @@
components.day = - (weekdayComponents.weekday - self.firstWeekday);
components.day = (components.day-7) % 7 + 6;
NSDate *lastDayOfWeek = [self dateByAddingComponents:components toDate:week options:0];
lastDayOfWeek = [self dateBySettingHour:0 minute:0 second:0 ofDate:lastDayOfWeek options:0];
lastDayOfWeek = [self startOfDayForDate:lastDayOfWeek];
components.day = NSIntegerMax;
return lastDayOfWeek;
}
@ -195,6 +195,11 @@
NSDateComponents *weekdayComponents = [self components:NSCalendarUnitWeekday fromDate:week];
NSDateComponents *componentsToSubtract = self.fs_privateComponents;
componentsToSubtract.day = - (weekdayComponents.weekday - self.firstWeekday) + 3;
// Fix https://github.com/WenchaoD/FSCalendar/issues/1100 and https://github.com/WenchaoD/FSCalendar/issues/1102
// If firstWeekday is not 1, and weekday is less than firstWeekday, the middleDayOfWeek will be the middle day of next week
if (weekdayComponents.weekday < self.firstWeekday) {
componentsToSubtract.day = componentsToSubtract.day - 7;
}
NSDate *middleDayOfWeek = [self dateByAddingComponents:componentsToSubtract toDate:week options:0];
NSDateComponents *components = [self components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:middleDayOfWeek];
middleDayOfWeek = [self dateFromComponents:components];

View File

@ -156,8 +156,8 @@
FSCalendarAppearance *appearance = self.calendar.appearance;
cell.titleLabel.font = appearance.headerTitleFont;
cell.titleLabel.textColor = appearance.headerTitleColor;
cell.titleLabel.textAlignment = appearance.headerTitleAlignment;
_calendar.formatter.dateFormat = appearance.headerDateFormat;
BOOL usesUpperCase = (appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase;
NSString *text = nil;
switch (self.calendar.transitionCoordinator.representingScope) {
case FSCalendarScopeMonth: {
@ -189,7 +189,13 @@
break;
}
}
text = usesUpperCase ? text.uppercaseString : text;
BOOL usesUpperCase = (appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase;
BOOL usesCapitalized = (appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesCapitalized;
if (usesUpperCase) {
text = text.uppercaseString;
} else if (usesCapitalized) {
text = text.capitalizedString;
}
cell.titleLabel.text = text;
[cell setNeedsLayout];
}
@ -211,7 +217,6 @@
self = [super initWithFrame:frame];
if (self) {
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
titleLabel.numberOfLines = 0;
[self.contentView addSubview:titleLabel];
@ -229,8 +234,11 @@
- (void)layoutSubviews
{
[super layoutSubviews];
self.titleLabel.frame = self.contentView.bounds;
CGPoint titleHeaderOffset = self.header.calendar.appearance.headerTitleOffset;
self.titleLabel.frame = CGRectOffset(self.contentView.bounds,
titleHeaderOffset.x,
titleHeaderOffset.y);
if (self.header.scrollDirection == UICollectionViewScrollDirectionHorizontal) {
CGFloat position = [self.contentView convertPoint:CGPointMake(CGRectGetMidX(self.contentView.bounds), CGRectGetMidY(self.contentView.bounds)) toView:self.header].x;

View File

@ -69,8 +69,12 @@
CGFloat titleHeight = [@"1" sizeWithAttributes:@{NSFontAttributeName:self.calendar.appearance.headerTitleFont}].height*1.5 + weekdayMargin*3;
_bottomBorder.frame = CGRectMake(0, _contentView.fs_height-weekdayHeight-weekdayMargin*2, _contentView.fs_width, 1.0);
_titleLabel.frame = CGRectMake(0, _bottomBorder.fs_bottom-titleHeight-weekdayMargin, titleWidth,titleHeight);
CGPoint titleHeaderOffset = self.calendar.appearance.headerTitleOffset;
_titleLabel.frame = CGRectMake(titleHeaderOffset.x,
titleHeaderOffset.y+_bottomBorder.fs_bottom-titleHeight-weekdayMargin,
titleWidth,
titleHeight);
}
#pragma mark - Properties
@ -90,6 +94,8 @@
{
_titleLabel.font = self.calendar.appearance.headerTitleFont;
_titleLabel.textColor = self.calendar.appearance.headerTitleColor;
_titleLabel.textAlignment = self.calendar.appearance.headerTitleAlignment;
_bottomBorder.backgroundColor = self.calendar.appearance.headerSeparatorColor;
[self.weekdayView configureAppearance];
}
@ -97,9 +103,16 @@
{
_month = month;
_calendar.formatter.dateFormat = self.calendar.appearance.headerDateFormat;
BOOL usesUpperCase = (self.calendar.appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase;
BOOL usesUpperCase = (self.calendar.appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase;
BOOL usesCapitalized = (self.calendar.appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesCapitalized;
NSString *text = [_calendar.formatter stringFromDate:_month];
text = usesUpperCase ? text.uppercaseString : text;
if (usesUpperCase) {
text = text.uppercaseString;
} else if (usesCapitalized) {
text = text.capitalizedString;
}
self.titleLabel.text = text;
}

View File

@ -9,18 +9,20 @@
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>8.0</string>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.8.0</string>
<string>2.8.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>282</string>
<key>NSPrincipalClass</key>
<string></string>
<key>net.goout.GoOut.groupIdentifier</key>
<string>$(GROUP_IDENTIFIER)</string>
</dict>
</plist>

View File

@ -0,0 +1 @@
../FSCalendar.h

View File

@ -0,0 +1 @@
../FSCalendarAppearance.h

View File

@ -0,0 +1 @@
../FSCalendarCalculator.h

View File

@ -0,0 +1 @@
../FSCalendarCell.h

View File

@ -0,0 +1 @@
../FSCalendarCollectionView.h

View File

@ -0,0 +1 @@
../FSCalendarCollectionViewLayout.h

View File

@ -0,0 +1 @@
../FSCalendarConstants.h

View File

@ -0,0 +1 @@
../FSCalendarDelegationFactory.h

View File

@ -0,0 +1 @@
../FSCalendarDelegationProxy.h

View File

@ -0,0 +1 @@
../FSCalendarDynamicHeader.h

View File

@ -0,0 +1 @@
../FSCalendarExtensions.h

View File

@ -0,0 +1 @@
../FSCalendarHeaderView.h

View File

@ -0,0 +1 @@
../FSCalendarSeparatorDecorationView.h

View File

@ -0,0 +1 @@
../FSCalendarStickyHeader.h

View File

@ -0,0 +1 @@
../FSCalendarTransitionCoordinator.h

View File

@ -0,0 +1 @@
../FSCalendarWeekdayView.h

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

20
Package.swift Normal file
View File

@ -0,0 +1,20 @@
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "FSCalendar",
platforms: [.iOS(.v9)],
products: [
.library(
name: "FSCalendar",
targets: ["FSCalendar"]
),
],
targets: [
.target(
name: "FSCalendar",
dependencies: [],
path: "FSCalendar/"
)
]
)

View File

@ -87,6 +87,13 @@ end
github "WenchaoD/FSCalendar"
```
## SPM:
Add dependency:
```swift
.package(url: "https://github.com/WenchaoD/FSCalendar.git", from: "2.8.3")
```
## Manually:
* Drag all files under `FSCalendar` folder into your project. 👍