-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit e228c06.
- Loading branch information
Showing
11 changed files
with
93 additions
and
247 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// RKColorSettings.swift | ||
// RKCalendar | ||
// | ||
// Copyright © 2019 Raffi Kian. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
import SwiftUI | ||
|
||
class RKColorSettings : ObservableObject { | ||
|
||
// foreground colors | ||
@Published var textColor: Color = Color.primary | ||
@Published var todayColor: Color = Color.white | ||
@Published var selectedColor: Color = Color.white | ||
@Published var disabledColor: Color = Color.gray | ||
@Published var betweenStartAndEndColor: Color = Color.white | ||
// background colors | ||
@Published var textBackColor: Color = Color.clear | ||
@Published var todayBackColor: Color = Color.gray | ||
@Published var selectedBackColor: Color = Color.red | ||
@Published var disabledBackColor: Color = Color.clear | ||
@Published var betweenStartAndEndBackColor: Color = Color.blue | ||
// headers foreground colors | ||
@Published var weekdayHeaderColor: Color = Color.primary | ||
@Published var monthHeaderColor: Color = Color.primary | ||
// headers background colors | ||
@Published var weekdayHeaderBackColor: Color = Color.clear | ||
@Published var monthBackColor: Color = Color.clear | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// RKManager.swift | ||
// RKCalendar | ||
// | ||
// Created by Raffi Kian on 7/14/19. | ||
// Copyright © 2019 Raffi Kian. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
class RKManager : ObservableObject { | ||
|
||
@Published var calendar = Calendar.current | ||
@Published var minimumDate: Date = Date() | ||
@Published var maximumDate: Date = Date() | ||
@Published var disabledDates: [Date] = [Date]() | ||
@Published var selectedDates: [Date] = [Date]() | ||
@Published var selectedDate: Date! = nil | ||
@Published var startDate: Date! = nil | ||
@Published var endDate: Date! = nil | ||
|
||
@Published var mode: Int = 0 | ||
|
||
var colors = RKColorSettings() | ||
|
||
init(calendar: Calendar, minimumDate: Date, maximumDate: Date, selectedDates: [Date] = [Date](), mode: Int) { | ||
self.calendar = calendar | ||
self.minimumDate = minimumDate | ||
self.maximumDate = maximumDate | ||
self.selectedDates = selectedDates | ||
self.mode = mode | ||
} | ||
|
||
func selectedDatesContains(date: Date) -> Bool { | ||
if let _ = self.selectedDates.first(where: { calendar.isDate($0, inSameDayAs: date) }) { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func selectedDatesFindIndex(date: Date) -> Int? { | ||
return self.selectedDates.firstIndex(where: { calendar.isDate($0, inSameDayAs: date) }) | ||
} | ||
|
||
func disabledDatesContains(date: Date) -> Bool { | ||
if let _ = self.disabledDates.first(where: { calendar.isDate($0, inSameDayAs: date) }) { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func disabledDatesFindIndex(date: Date) -> Int? { | ||
return self.disabledDates.firstIndex(where: { calendar.isDate($0, inSameDayAs: date) }) | ||
} | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.