Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b47222f
Change range deselection behavior to automatically select new range
keagan Dec 21, 2015
951e326
Bump deployment target, and xib version, to 8.2
keagan Dec 21, 2015
0b681b1
Hacked up pretty good to match jardson's design
keagan Apr 21, 2016
7958967
More hacking
keagan Apr 21, 2016
92b5127
More hacking to make cell selection work now that there are spacer cells
keagan Apr 21, 2016
cda102a
More hackage
keagan Apr 21, 2016
bf8e4f6
Empty month label by default
keagan Apr 21, 2016
cee97f0
Color past dates light grey
keagan Apr 25, 2016
37114a7
Moar calendar hackage
keagan Apr 27, 2016
eba49dc
Make sure date ranges that cross month boundaries round off the corne…
keagan Apr 27, 2016
c0621c6
Fix calendar range selection drawing when beginning of month is last …
keagan Apr 27, 2016
efea737
Fix drawing single selected date as orange (not just grey)
keagan Apr 29, 2016
20bf9fb
Allow selecting same begin and end dates
keagan May 3, 2016
c52f254
Fix outline glitch when single selecting today
keagan May 3, 2016
c1c89a7
Comment out code that xcode8's more restrictive settings complain about
keagan Sep 14, 2016
55ca44e
Don't store calendar in thread local dictionary, just create fresh fo…
keagan Jan 30, 2017
3646cd4
Fix deprecation warning
keagan Mar 27, 2017
6d2e98d
Update background color of calendar
keagan Mar 12, 2018
aba644a
Use rebranded colors
keagan Aug 13, 2018
c2e3e2c
Upstreaming divvy whitelabel changes
keagan Jul 12, 2019
bb79790
Updates to make calendar backgrounds transparent, so dark mode can sh…
keagan May 5, 2020
4aed940
Updated deployment target for xibs
Oct 15, 2020
f53872a
Updated project settings
Oct 15, 2020
7496df1
Merge pull request #1 from tripactions/improvement/project-settings-u…
Oct 16, 2020
1990aa6
Adding CODEOWNERS
vinnayragghavan Jun 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @tripactions/trips-team

37 changes: 33 additions & 4 deletions GLCalendarView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
FA2D5F3A1AF0C101003D4CE7 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = glow;
TargetAttributes = {
FA2D5F411AF0C101003D4CE7 = {
Expand All @@ -254,7 +254,7 @@
};
buildConfigurationList = FA2D5F3D1AF0C101003D4CE7 /* Build configuration list for PBXProject "GLCalendarView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -340,20 +340,33 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -366,7 +379,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -381,27 +394,39 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand All @@ -414,6 +439,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = GLCalendarView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.glowing.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -424,6 +450,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = GLCalendarView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.glowing.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand All @@ -442,6 +469,7 @@
);
INFOPLIST_FILE = GLCalendarViewTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.glowing.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GLCalendarView.app/GLCalendarView";
};
Expand All @@ -457,6 +485,7 @@
);
INFOPLIST_FILE = GLCalendarViewTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.glowing.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GLCalendarView.app/GLCalendarView";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
21 changes: 11 additions & 10 deletions GLCalendarView/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,30 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.

[UINavigationBar appearance].barTintColor = UIColorFromRGB(0x79a9cd);
[UINavigationBar appearance].barTintColor = [UIColor whiteColor]; // UIColorFromRGB(0x79a9cd);
[UINavigationBar appearance].tintColor = [UIColor whiteColor];
[UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
// [UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
// [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];


[GLCalendarView appearance].rowHeight = 54;
[GLCalendarView appearance].padding = 6;
[GLCalendarView appearance].rowHeight = 48;
[GLCalendarView appearance].padding = 20;

[GLCalendarView appearance].weekDayTitleAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:8], NSForegroundColorAttributeName:[UIColor grayColor]};
[GLCalendarView appearance].weekDayTitleAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:UIColorFromRGB(0x4E4E4E)};
[GLCalendarView appearance].monthCoverAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:30]};
[GLCalendarDayCell appearance].evenMonthBackgroundColor = UIColorFromRGB(0xf5f5f5);
[GLCalendarDayCell appearance].oddMonthBackgroundColor = UIColorFromRGB(0xf8f8f8);
[GLCalendarDayCell appearance].evenMonthBackgroundColor = UIColorFromRGB(0xf8f8f8);

[GLCalendarDayCell appearance].rangeDisplayMode = RANGE_DISPLAY_MODE_CONTINUOUS;

[GLCalendarDayCell appearance].dayLabelAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:20], NSForegroundColorAttributeName:UIColorFromRGB(0x555555)};
[GLCalendarDayCell appearance].monthLabelAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:8]};
[GLCalendarDayCell appearance].dayLabelAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18], NSForegroundColorAttributeName:UIColorFromRGB(0x4E4E4E)};
[GLCalendarDayCell appearance].monthLabelAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:UIColorFromRGB(0xFF671B)};

[GLCalendarDayCell appearance].editCoverBorderWidth = 2;
[GLCalendarDayCell appearance].editCoverBorderColor = UIColorFromRGB(0x366aac);
[GLCalendarDayCell appearance].editCoverPointSize = 14;

[GLCalendarDayCell appearance].todayBackgroundColor = UIColorFromRGB(0x366aac);
[GLCalendarDayCell appearance].todayBackgroundColor = UIColorFromRGB(0x4E4E4E);
[GLCalendarDayCell appearance].todayLabelAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:20]};

return YES;
Expand Down
15 changes: 10 additions & 5 deletions GLCalendarView/Demo/GLCalendarViewDemoController.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,32 @@ - (void)viewDidLoad {
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];

[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = nil;

NSDate *today = [NSDate date];

NSDate *beginDate1 = [GLDateUtils dateByAddingDays:-32 toDate:today];
NSDate *endDate1 = [GLDateUtils dateByAddingDays:-26 toDate:today];
GLCalendarDateRange *range1 = [GLCalendarDateRange rangeWithBeginDate:beginDate1 endDate:endDate1];
range1.backgroundColor = UIColorFromRGB(0x79a9cd);
range1.backgroundColor = UIColorFromRGB(0xEBEBEB);
range1.textColor = UIColorFromRGB(0x4E4E4E);
range1.editable = YES;

NSDate *beginDate2 = [GLDateUtils dateByAddingDays:-6 toDate:today];
NSDate *endDate2 = [GLDateUtils dateByAddingDays:-3 toDate:today];
GLCalendarDateRange *range2 = [GLCalendarDateRange rangeWithBeginDate:beginDate2 endDate:endDate2];
range2.backgroundColor = UIColorFromRGB(0x79a9cd);
range2.backgroundColor = UIColorFromRGB(0xEBEBEB);
range2.textColor = UIColorFromRGB(0x4E4E4E);
range2.editable = YES;

self.calendarView.ranges = [@[range1, range2] mutableCopy];

[self.calendarView reload];
dispatch_async(dispatch_get_main_queue(), ^{
[self.calendarView scrollToDate:self.calendarView.lastDate animated:NO];
});
// dispatch_async(dispatch_get_main_queue(), ^{
// [self.calendarView scrollToDate:self.calendarView.lastDate animated:NO];
// });
}

- (BOOL)calenderView:(GLCalendarView *)calendarView canAddRangeWithBeginDate:(NSDate *)beginDate
Expand Down
17 changes: 8 additions & 9 deletions GLCalendarView/Demo/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="pjR-1Q-QsB">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="pjR-1Q-QsB">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--GLCalendarView-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="GLCalendarViewDemoController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="504"/>
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="kbh-zD-zoS" customClass="GLCalendarView">
Expand Down Expand Up @@ -43,9 +44,12 @@
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="pjR-1Q-QsB" sceneMemberID="viewController">
<toolbarItems/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="EMO-QP-Xun">
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="EMO-QP-Xun">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<textAttributes key="titleTextAttributes">
<color key="textShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</textAttributes>
</navigationBar>
<nil name="viewControllers"/>
<connections>
Expand All @@ -57,9 +61,4 @@
<point key="canvasLocation" x="128" y="385"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
6 changes: 3 additions & 3 deletions GLCalendarView/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.glowing.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -30,13 +30,13 @@
<array>
<string>armv7</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
5 changes: 5 additions & 0 deletions GLCalendarView/Sources/GLCalendarDayCell/GLCalendarDayCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ typedef NS_ENUM(NSInteger, CELL_POSITION) {
POSITION_NORMAL = 0,
POSITION_LEFT_EDGE = 1,
POSITION_RIGHT_EDGE = 2,
POSITION_BOTH_EDGES = 3,
};

typedef NS_ENUM(NSInteger, ENLARGE_POINT) {
Expand All @@ -27,13 +28,17 @@ typedef NS_ENUM(NSInteger, RANGE_DISPLAY_MODE) {
};

@interface GLCalendarDayCell : UICollectionViewCell

@property (nonatomic, readwrite) NSCalendar *calendar;
@property (nonatomic, strong) UIColor *evenMonthBackgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *oddMonthBackgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) NSDictionary *dayLabelAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) NSDictionary *dragDayLabelAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) NSDictionary *futureDayLabelAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) NSDictionary *todayLabelAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) NSDictionary *monthLabelAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *todayBackgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *orangeColor UI_APPEARANCE_SELECTOR;

@property (nonatomic) CGFloat editCoverPadding UI_APPEARANCE_SELECTOR;
@property (nonatomic) CGFloat editCoverBorderWidth UI_APPEARANCE_SELECTOR;
Expand Down
Loading