-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b227c1e
commit 37974bb
Showing
8 changed files
with
120 additions
and
64 deletions.
There are no files selected for viewing
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,23 @@ | ||
// | ||
// MWeekday.swift of CalendarView | ||
// | ||
// Created by Alina Petrovska on 29.10.2023. | ||
// - Mail: alina.petrovskaya@mijick.com | ||
// - GitHub: https://github.com/Mijick | ||
// | ||
// Copyright ©2023 Mijick. Licensed under MIT License. | ||
|
||
|
||
extension MWeekday { | ||
static var allCases: [MWeekday] { | ||
let firstDayIndex = MCalendar.firstWeekday.rawValue | ||
let weekDaysIndexes = [Int](firstDayIndex ... 7) + [Int](1 ..< firstDayIndex) | ||
|
||
return .init(weekDaysIndexes) | ||
} | ||
} | ||
|
||
// MARK: - Helpers | ||
fileprivate extension [MWeekday] { | ||
init(_ indexes: [Int]) { self = indexes.compactMap { .init(rawValue: $0) }} | ||
} |
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
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
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
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
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
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
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