-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from gertrude-app/timespan
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/// A wall-clock time not associated with a particular date or time zone | ||
public struct PlainTime { | ||
var hour: UInt8 | ||
var minute: UInt8 | ||
|
||
public init(hour: UInt8, minute: UInt8) { | ||
self.hour = hour | ||
self.minute = minute | ||
} | ||
} | ||
|
||
/// A time "window" with a start and end not | ||
/// associated with a particular date or time zone | ||
public struct PlainTimeWindow { | ||
var start: PlainTime | ||
var end: PlainTime | ||
|
||
public init(start: PlainTime, end: PlainTime) { | ||
self.start = start | ||
self.end = end | ||
} | ||
} | ||
|
||
// extensions | ||
|
||
extension PlainTime: Sendable, Equatable, Hashable, Codable {} | ||
extension PlainTimeWindow: Sendable, Equatable, Hashable, Codable {} |