-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/add-side-event-list
- Loading branch information
Showing
18 changed files
with
344 additions
and
103 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
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
29 changes: 5 additions & 24 deletions
29
app-ios/Modules/Sources/Model/TimetableTimeGroupItems.swift
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 |
---|---|---|
@@ -1,36 +1,17 @@ | ||
import shared | ||
|
||
public struct TimetableTimeGroupItems: Identifiable, Equatable, Hashable { | ||
public struct Duration: Hashable { | ||
public let startsAt: Kotlinx_datetimeInstant | ||
public let endsAt: Kotlinx_datetimeInstant | ||
|
||
var minute: Int { | ||
let startMinute = Int(startsAt.epochSeconds) / 60 | ||
let endMinute = Int(endsAt.epochSeconds) / 60 | ||
|
||
return endMinute - startMinute | ||
} | ||
|
||
public init(startsAt: Kotlinx_datetimeInstant, endsAt: Kotlinx_datetimeInstant) { | ||
self.startsAt = startsAt | ||
self.endsAt = endsAt | ||
} | ||
} | ||
|
||
public var id: String { | ||
UUID().uuidString | ||
} | ||
|
||
public var startsAt: Date | ||
public var endsAt: Date | ||
public var minute: Int | ||
public var startsTimeString: String | ||
public var endsTimeString: String | ||
public var items: [TimetableItemWithFavorite] | ||
|
||
public init(duration: Duration, items: [TimetableItemWithFavorite]) { | ||
self.startsAt = duration.startsAt.toDate() | ||
self.endsAt = duration.endsAt.toDate() | ||
self.minute = duration.minute | ||
public init(startsTimeString: String, endsTimeString: String, items: [TimetableItemWithFavorite]) { | ||
self.startsTimeString = startsTimeString | ||
self.endsTimeString = endsTimeString | ||
self.items = items | ||
} | ||
} |
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
Oops, something went wrong.