Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21 milestone1 adding holiday calendar #328

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
da11c61
Somewhat functional
cadechaplin Feb 25, 2025
35060c4
Change to Readme
cadechaplin Feb 25, 2025
c7e0153
Move DayComponents to own file for expansion
swiftlydesigner Mar 1, 2025
0641fc7
Change DayComponents to type Day in all references
swiftlydesigner Mar 1, 2025
5663cb9
Stop tracking changes to project.pbxproj in example
swiftlydesigner Mar 1, 2025
0f897b2
feature added
cadechaplin Mar 1, 2025
af12e24
Add isEnabled to SwiftUIDayView
swiftlydesigner Mar 1, 2025
35a859f
Block selecting dates that are start or end
swiftlydesigner Mar 1, 2025
5465ddd
Add date init to DayComponents
swiftlydesigner Mar 2, 2025
0cd17a6
Ensure disabled dates are excluded from the range
swiftlydesigner Mar 2, 2025
f60d917
Create UI for Demoing Disabled Days
swiftlydesigner Mar 2, 2025
25e62ab
Remove unnecessary print statements
swiftlydesigner Mar 2, 2025
4e141ef
Add Preview for SwiftUIDayView
swiftlydesigner Mar 2, 2025
1a0cd38
Remove unnecessary white spaces
swiftlydesigner Mar 2, 2025
e0ea3f1
Resolve Linter Warnings
swiftlydesigner Mar 2, 2025
4c856bc
Fix Curly Brace Spacing
swiftlydesigner Mar 2, 2025
c8f9206
Fix Linter Warnings in DayView
swiftlydesigner Mar 2, 2025
1a527da
Update Lint Warnings
swiftlydesigner Mar 2, 2025
41f37d4
Remove unnecessary white spaces
swiftlydesigner Mar 2, 2025
1a904ac
Add Tests for DayComponents
swiftlydesigner Mar 2, 2025
7757e45
Correct operator under test
swiftlydesigner Mar 2, 2025
ecb173a
Refactor logic code to the engine in DayRangeSelectionHelper
swiftlydesigner Mar 2, 2025
64fbb43
Add Documentation to DayRangeSelectionHelper enum
swiftlydesigner Mar 2, 2025
5e877f3
Resolve SwiftLinter warnings
swiftlydesigner Mar 2, 2025
8209eae
Move file in sidebar
swiftlydesigner Mar 2, 2025
d43bd70
Add protocol for Day
swiftlydesigner Mar 2, 2025
47d8f21
Add Protocol to DayComponents
swiftlydesigner Mar 2, 2025
1138249
DayProtocol must conform to Comparable as well
swiftlydesigner Mar 2, 2025
fce541f
Merge pull request #8 from WSU-CptS-581-2025/kp/tooltips-and-avoid-to…
swiftlydesigner Mar 2, 2025
86a1f40
Merge branch 'milestone-one' into removable_days
swiftlydesigner Mar 2, 2025
58cb6d8
Merge pull request #6 from WSU-CptS-581-2025/removable_days
swiftlydesigner Mar 2, 2025
c2cefcd
Update File References
swiftlydesigner Mar 2, 2025
8aef9f5
Fix project link after merge
swiftlydesigner Mar 2, 2025
7b47026
Fix post-signing build issue
swiftlydesigner Mar 2, 2025
ea25c85
Resolve build errors with mislinked files
swiftlydesigner Mar 2, 2025
95f3400
Fix reference of DayComponents to Day
swiftlydesigner Mar 2, 2025
4bc38ac
change to broken test file
cadechaplin Mar 2, 2025
4865bf9
Merge pull request #10 from WSU-CptS-581-2025/kp/resolve-build-issues…
swiftlydesigner Mar 2, 2025
435537e
Added test file
cadechaplin Mar 2, 2025
39babe1
removed contextless comments
cadechaplin Mar 2, 2025
3c9c13c
Add SwiftUI Screen for Week View
swiftlydesigner Mar 2, 2025
15f2483
Correct references to correct UI
swiftlydesigner Mar 2, 2025
edb098b
Allow discarded result on call to updateDayRange
swiftlydesigner Mar 2, 2025
c7a468e
Pin week days to top
swiftlydesigner Mar 2, 2025
35f8bd8
Add height to view one week at a time
swiftlydesigner Mar 2, 2025
ab8b085
Fix Spacing
swiftlydesigner Mar 2, 2025
547e681
Fix Formatting of Public Code
swiftlydesigner Mar 2, 2025
c265db4
Merge branch 'milestone-one' into DisplayWeekNumberInCalender
swiftlydesigner Mar 2, 2025
e08e376
Merge pull request #11 from WSU-CptS-581-2025/DisplayWeekNumberInCale…
swiftlydesigner Mar 2, 2025
d80ce75
Merge pull request #12 from WSU-CptS-581-2025/kp/support-week-view
swiftlydesigner Mar 2, 2025
da0c411
Add test project to resolve build error
swiftlydesigner Mar 2, 2025
f4358c7
Add preview view controller
swiftlydesigner Mar 2, 2025
c46d830
Add discardableResult to DayRangeSelectionHelper ext
swiftlydesigner Mar 2, 2025
a9941cc
Add flex week to demo picker
swiftlydesigner Mar 2, 2025
2c8bc95
Select the current day on selection
swiftlydesigner Mar 2, 2025
e4c20ed
Fix scroll position
swiftlydesigner Mar 2, 2025
3d3361d
Implemented
cadechaplin Mar 2, 2025
a4696fd
Merge pull request #14 from WSU-CptS-581-2025/kp/inserting-flexible-h…
swiftlydesigner Mar 2, 2025
70f379d
Fix TooltipView Spacing
swiftlydesigner Mar 2, 2025
8cb9b3e
Increase linespacing and show tooltip on selection
swiftlydesigner Mar 2, 2025
436f567
Add SelectedDayView
swiftlydesigner Mar 2, 2025
35065ed
Enable editing of notes
swiftlydesigner Mar 3, 2025
ddfd2ed
Remove debug code
swiftlydesigner Mar 3, 2025
42dc0f8
Fix warnings from linter
swiftlydesigner Mar 3, 2025
d0f487f
Fix warnings from linter
swiftlydesigner Mar 3, 2025
3714026
Merge pull request #15 from WSU-CptS-581-2025/kp/inserting-flexible-h…
swiftlydesigner Mar 3, 2025
e97023e
Merge pull request #16 from WSU-CptS-581-2025/Adding_Scroll_to_Today_…
swiftlydesigner Mar 3, 2025
102d5dc
Update DemoPickerViewController.swift To add holiday calendar
apramc Mar 3, 2025
bab2706
Add files via upload
apramc Mar 3, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ fastlane/test_output
xcshareddata
UserInterfaceState.xcuserstate
.DS_Store
#Example/HorizonCalendarExample/HorizonCalendarExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
645FFEFC2D6D5E61002EE721 /* WeekdayOnlyDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645FFEFB2D6D5E61002EE721 /* WeekdayOnlyDemoViewController.swift */; };
645FFF022D73B86A002EE721 /* WeekNumberDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645FFF012D73B86A002EE721 /* WeekNumberDemoViewController.swift */; };
9381769C249B74BB00E18FA3 /* DemoPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9381769B249B74BB00E18FA3 /* DemoPickerViewController.swift */; };
9381769F249B79DC00E18FA3 /* ScrollToDayWithAnimationDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9381769E249B79DC00E18FA3 /* ScrollToDayWithAnimationDemoViewController.swift */; };
938176A1249B7CE600E18FA3 /* DayRangeSelectionDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938176A0249B7CE600E18FA3 /* DayRangeSelectionDemoViewController.swift */; };
Expand All @@ -22,7 +24,11 @@
939E69942484D55200A8BCC7 /* HorizonCalendar.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 939E69912484D11000A8BCC7 /* HorizonCalendar.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
93A7258E24A1F26C00B4F08F /* PartialMonthVisibilityDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93A7258D24A1F26C00B4F08F /* PartialMonthVisibilityDemoViewController.swift */; };
93AF5545248DCC8900BDB0FF /* DayRangeIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93AF5544248DCC8900BDB0FF /* DayRangeIndicatorView.swift */; };
FD53899F299476AD007D56EB /* DayRangeSelectionTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD53899E299476AD007D56EB /* DayRangeSelectionTracker.swift */; };
AA79A7D12D74319B00C07DD0 /* SwiftUIDisabledDayDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA79A7D02D74319B00C07DD0 /* SwiftUIDisabledDayDemoViewController.swift */; };
AA79A7D52D74346200C07DD0 /* DayRangeSelectionHelperExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA79A7D42D74346200C07DD0 /* DayRangeSelectionHelperExtension.swift */; };
AA79A7E02D74E1F400C07DD0 /* SwiftUIWeekViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA79A7DF2D74E1F400C07DD0 /* SwiftUIWeekViewViewController.swift */; };
AA79A83E2D750BCC00C07DD0 /* SwiftUIFlexWeekViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA79A83D2D750BCC00C07DD0 /* SwiftUIFlexWeekViewController.swift */; };
AA79A88A2D751C0600C07DD0 /* SelectedDayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA79A8892D751C0600C07DD0 /* SelectedDayView.swift */; };
FD55C5D7298B138A00A9B5D6 /* SwiftUIScreenDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD55C5D6298B138A00A9B5D6 /* SwiftUIScreenDemoViewController.swift */; };
FDA0FB3528F5EFD90066DEFA /* SwiftUIDayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA0FB3428F5EFD90066DEFA /* SwiftUIDayView.swift */; };
FDA0FB3728F5EFF60066DEFA /* SwiftUIItemModelsDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA0FB3628F5EFF60066DEFA /* SwiftUIItemModelsDemoViewController.swift */; };
Expand All @@ -44,6 +50,8 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
645FFEFB2D6D5E61002EE721 /* WeekdayOnlyDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekdayOnlyDemoViewController.swift; sourceTree = "<group>"; };
645FFF012D73B86A002EE721 /* WeekNumberDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekNumberDemoViewController.swift; sourceTree = "<group>"; };
9381769B249B74BB00E18FA3 /* DemoPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoPickerViewController.swift; sourceTree = "<group>"; };
9381769E249B79DC00E18FA3 /* ScrollToDayWithAnimationDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollToDayWithAnimationDemoViewController.swift; sourceTree = "<group>"; };
938176A0249B7CE600E18FA3 /* DayRangeSelectionDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayRangeSelectionDemoViewController.swift; sourceTree = "<group>"; };
Expand All @@ -60,7 +68,11 @@
939E69912484D11000A8BCC7 /* HorizonCalendar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = HorizonCalendar.framework; sourceTree = BUILT_PRODUCTS_DIR; };
93A7258D24A1F26C00B4F08F /* PartialMonthVisibilityDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartialMonthVisibilityDemoViewController.swift; sourceTree = "<group>"; };
93AF5544248DCC8900BDB0FF /* DayRangeIndicatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayRangeIndicatorView.swift; sourceTree = "<group>"; };
FD53899E299476AD007D56EB /* DayRangeSelectionTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayRangeSelectionTracker.swift; sourceTree = "<group>"; };
AA79A7D02D74319B00C07DD0 /* SwiftUIDisabledDayDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIDisabledDayDemoViewController.swift; sourceTree = "<group>"; };
AA79A7D42D74346200C07DD0 /* DayRangeSelectionHelperExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayRangeSelectionHelperExtension.swift; sourceTree = "<group>"; };
AA79A7DF2D74E1F400C07DD0 /* SwiftUIWeekViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIWeekViewViewController.swift; sourceTree = "<group>"; };
AA79A83D2D750BCC00C07DD0 /* SwiftUIFlexWeekViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIFlexWeekViewController.swift; sourceTree = "<group>"; };
AA79A8892D751C0600C07DD0 /* SelectedDayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedDayView.swift; sourceTree = "<group>"; };
FD55C5D6298B138A00A9B5D6 /* SwiftUIScreenDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIScreenDemoViewController.swift; sourceTree = "<group>"; };
FDA0FB3428F5EFD90066DEFA /* SwiftUIDayView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIDayView.swift; sourceTree = "<group>"; };
FDA0FB3628F5EFF60066DEFA /* SwiftUIItemModelsDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIItemModelsDemoViewController.swift; sourceTree = "<group>"; };
Expand All @@ -83,6 +95,7 @@
isa = PBXGroup;
children = (
938176A6249B85CE00E18FA3 /* DemoViewController.swift */,
645FFF012D73B86A002EE721 /* WeekNumberDemoViewController.swift */,
939E696E2484CD8E00A8BCC7 /* SingleDaySelectionDemoViewController.swift */,
938176A0249B7CE600E18FA3 /* DayRangeSelectionDemoViewController.swift */,
938176A2249B7F0800E18FA3 /* SelectedDayTooltipDemoViewController.swift */,
Expand All @@ -92,6 +105,10 @@
FDD8EE7329885AF500F6EC9D /* MonthBackgroundDemoViewController.swift */,
FDA0FB3628F5EFF60066DEFA /* SwiftUIItemModelsDemoViewController.swift */,
FD55C5D6298B138A00A9B5D6 /* SwiftUIScreenDemoViewController.swift */,
645FFEFB2D6D5E61002EE721 /* WeekdayOnlyDemoViewController.swift */,
AA79A7D02D74319B00C07DD0 /* SwiftUIDisabledDayDemoViewController.swift */,
AA79A7DF2D74E1F400C07DD0 /* SwiftUIWeekViewViewController.swift */,
AA79A83D2D750BCC00C07DD0 /* SwiftUIFlexWeekViewController.swift */,
);
path = "Demo View Controllers";
sourceTree = "<group>";
Expand Down Expand Up @@ -119,10 +136,11 @@
939E696A2484CD8E00A8BCC7 /* AppDelegate.swift */,
9381769B249B74BB00E18FA3 /* DemoPickerViewController.swift */,
9381769D249B79CB00E18FA3 /* Demo View Controllers */,
FD53899E299476AD007D56EB /* DayRangeSelectionTracker.swift */,
93AF5544248DCC8900BDB0FF /* DayRangeIndicatorView.swift */,
AA79A7D42D74346200C07DD0 /* DayRangeSelectionHelperExtension.swift */,
FDA0FB3428F5EFD90066DEFA /* SwiftUIDayView.swift */,
939853512498992E0022A3A1 /* TooltipView.swift */,
AA79A8892D751C0600C07DD0 /* SelectedDayView.swift */,
939E69732484CD9000A8BCC7 /* Assets.xcassets */,
939E69752484CD9000A8BCC7 /* LaunchScreen.storyboard */,
939E69782484CD9000A8BCC7 /* Info.plist */,
Expand Down Expand Up @@ -214,16 +232,22 @@
939E696F2484CD8E00A8BCC7 /* SingleDaySelectionDemoViewController.swift in Sources */,
938176A3249B7F0800E18FA3 /* SelectedDayTooltipDemoViewController.swift in Sources */,
FDA0FB3528F5EFD90066DEFA /* SwiftUIDayView.swift in Sources */,
645FFEFC2D6D5E61002EE721 /* WeekdayOnlyDemoViewController.swift in Sources */,
938176A1249B7CE600E18FA3 /* DayRangeSelectionDemoViewController.swift in Sources */,
FD53899F299476AD007D56EB /* DayRangeSelectionTracker.swift in Sources */,
9381769C249B74BB00E18FA3 /* DemoPickerViewController.swift in Sources */,
939853522498992E0022A3A1 /* TooltipView.swift in Sources */,
AA79A7D52D74346200C07DD0 /* DayRangeSelectionHelperExtension.swift in Sources */,
AA79A88A2D751C0600C07DD0 /* SelectedDayView.swift in Sources */,
AA79A83E2D750BCC00C07DD0 /* SwiftUIFlexWeekViewController.swift in Sources */,
938176A7249B85CE00E18FA3 /* DemoViewController.swift in Sources */,
9381769F249B79DC00E18FA3 /* ScrollToDayWithAnimationDemoViewController.swift in Sources */,
93AF5545248DCC8900BDB0FF /* DayRangeIndicatorView.swift in Sources */,
645FFF022D73B86A002EE721 /* WeekNumberDemoViewController.swift in Sources */,
938176A5249B828600E18FA3 /* LargeDayRangeDemoViewController.swift in Sources */,
AA79A7E02D74E1F400C07DD0 /* SwiftUIWeekViewViewController.swift in Sources */,
FDD8EE7429885AF500F6EC9D /* MonthBackgroundDemoViewController.swift in Sources */,
FD55C5D7298B138A00A9B5D6 /* SwiftUIScreenDemoViewController.swift in Sources */,
AA79A7D12D74319B00C07DD0 /* SwiftUIDisabledDayDemoViewController.swift in Sources */,
939E696B2484CD8E00A8BCC7 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ extension DayRangeIndicatorView: CalendarItemViewRepresentable {

static func makeView(
withInvariantViewProperties invariantViewProperties: InvariantViewProperties)
-> DayRangeIndicatorView
{
-> DayRangeIndicatorView {
DayRangeIndicatorView(indicatorColor: invariantViewProperties.indicatorColor)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Created by Bryan Keller on 2/8/23.
// Copyright © 2023 Airbnb Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import HorizonCalendar
import UIKit

extension DayRangeSelectionHelper {

@discardableResult
static func updateDayRange(afterDragSelectionOf day: Day,
existingDayRange: inout DayComponentsRange?,
initialDayRange: inout DayComponentsRange?,
state: UIGestureRecognizer.State,
calendar: Calendar) -> Set<Date> {

let invalidDates = getInvalidDateSet(day, existingDayRange, calendar)

guard invalidDates == [] else { return invalidDates }

switch state {
case .began:
if day != existingDayRange?.lowerBound, day != existingDayRange?.upperBound {
existingDayRange = day...day
}
initialDayRange = existingDayRange

case .changed, .ended:
guard initialDayRange != nil else {
fatalError("`initialDayRange` should not be `nil`")
}

performUpdateRange(day,
&existingDayRange,
&initialDayRange,
calendar)

default:
existingDayRange = nil
initialDayRange = nil
}



return []
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ final class DayRangeSelectionDemoViewController: BaseDemoViewController {
calendar: calendar,
visibleDateRange: startDate...endDate,
monthsLayout: monthsLayout)


.interMonthSpacing(24)
.verticalDayMargin(8)
.horizontalDayMargin(8)


.dayItemProvider { [calendar, dayDateFormatter] day in
var invariantViewProperties = DayView.InvariantViewProperties.baseInteractive
Expand Down
Loading